SQL partition problem in PHP file
$query = ' SELECT * from authorized_users where name= "'. $userid. '" and Password=sha1 ("'. $password. '") ';
Is that the right thing to say?
Share to:
------Solution--------------------
strings are enclosed in single quotes.
------Solution--------------------
Reference:
$query = ' select * from authorized_users where name= "'. $userid. '" and Password=sha1 ("'. $password. '" )';
Is that the right thing to say?
$query = "SELECT * from Authorized_users where name= ' $userid ' and password= ' {SHA1 ($password)} '";
------Solution--------------------
$query = ' SELECT * from authorized_users where name= "'. $userid. '" and Password=sha1 ("'. $password. '") ';
Grammatically correct, but not readable
$query = "SELECT * from Authorized_users where name= ' $userid ' and password=sha1 (' $password ')";
Isn't that refreshing?