SQL segmentation in the PHP file $ querySelect & nbsp; * & nbsp; from & nbsp; authorized_users & nbsp; where & nbsp; name & nbsp ;. $ userid. & nbsp; and & nbsp; passwordsha1 (. $ password .); is this correct? SQL segmentation in php files
$ Query = 'select * from authorized_users where name = "'. $ userid.'" and password = sha1 ("'. $ password .'")';
Is this correct?
Share:
------ Solution --------------------
Strings are enclosed in single quotes.
------ Solution --------------------
Reference:
$ Query = 'select * from authorized_users where name = "'. $ userid.'" and password = sha1 ("'. $ password .'")';
Is this correct?
$ 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 .'")';
The syntax is correct, but the readability is not strong.
$ Query = "Select * from authorized_users where name = '$ userid' and password = sha1 (' $ password ')";
Is this refreshing?