Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: problem with login script

by marinersk (Priest)
on Oct 28, 2013 at 18:53 UTC ( #1060039=note: print w/replies, xml ) Need Help??


in reply to problem with login script

Two suggestions.

  1. Change:
    #!C:/Perl64/bin/perl.exe
    use DBI;

    to

    #!C:/Perl64/bin/perl.exe
    use strict;
    use warnings;
    use DBI;

    and;
     

  2. Change:
    $sth = $dbh->prepare("SELECT username, password FROM users WHERE username =$username and password=$password");

    to

    my $sqlStatement = "SELECT username, password FROM users WHERE username =$username and password=$password";
    print "Submitting:  $sqlStatement\n";
    $sth = $dbh->prepare($sqlStatement);

     

See what the full SQL statement looks like; you are likely to find an error there, since that's what your error message says.

Most SQL requires strings to be encapsulated in single-quotes:  ... and password = 'newpassword';

Dunno if that's your problem, but the above changes should help shed light on what you are getting wrong in the SQL statement.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2023-11-30 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?