Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: problem with login script

by marinersk (Priest)
on Oct 28, 2013 at 18:53 UTC ( [id://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 drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2025-06-21 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.