www.webdeveloper.com
Results 1 to 3 of 3

Thread: Sql

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Posts
    53

    Sql

    what's wrong?

    String s = "SELECT * from login WHERE id = '"+ userId + "' AND password = '" + userPw + "'";
    <% out.print("Hello World!"); %>

  2. #2
    Join Date
    Dec 2002
    Location
    Pleasanton, CA
    Posts
    2,132
    If this is mySQL for Perl, then...

    my $s = "SELECT * FROM login WHERE id = '$userId' AND password = '$userPw'";
    where..
    my is used in a strict enviroment (left out if not using strict.)
    $s is a string variable (use $sql or $query instead, it's easier to debug later)
    'login' is the name of the table (NOT a variable)
    $userId and $userPW are variables.

    Does that help?

  3. #3
    Join Date
    Feb 2003
    Posts
    53
    Originally posted by nedals
    If this is mySQL for Perl, then...

    my $s = "SELECT * FROM login WHERE id = '$userId' AND password = '$userPw'";
    where..
    my is used in a strict enviroment (left out if not using strict.)
    $s is a string variable (use $sql or $query instead, it's easier to debug later)
    'login' is the name of the table (NOT a variable)
    $userId and $userPW are variables.

    Does that help?
    sorry i am using it for jsp. thanks anyway for your reply!
    <% out.print("Hello World!"); %>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles