in reply to Debugging a login script using MySQL
A user called ' or 1=1 -- could probably login without a password. That should really be:my $sth = $dbh->prepare("SELECT * FROM $users_table WHERE username = ' +$username' AND user_password = '$userpass'"); $sth->execute;
my $sth = $dbh->prepare("SELECT * FROM $users_table WHERE username = ? + AND user_password = ?"); $sth->execute($username, $userpass);
|
|---|