Querying MySQL with PHP -
What's wrong with this code:
$ q = query User where email = '$ _POST [' email ']' and name = '$ _POST [' name ']' "); Parsing error: Parsing error, T_STRING 'or
T_VARIABLE' or `T_NUM_STRING 'C: \ wamp \ www \ conn \ index.php on Line 16 Thanks in advance.
$ q = query (select "* from users where email = '{$ _POST [ 'Email']} 'and name =' {$ _POST ['name'] '} ");
You have missed two quotes besides:
1) Always avoid user input (for):
$ email = mysql_real_escape_string ($ _ POST ['email']); $ Name = mysql_real_escape_string ($ _ POST ['name']); $ Q = Query ("Choose from user where * email = '{$ email}' and name = '{$ name}' ');
2) An editor highlighting code Find, so that you do not get similar problems in the future. I recommend.
Comments
Post a Comment