An error occurred in the query statement. I haven't found it for a long time. who can help me! I set the condition that number = 512 only has one record that meets the condition in the database, but every time I traverse the output, all the data is output? The cause cannot be found all the time. PHPcode $ SQL = & quot; select * from 'test' where has an error in the query statement. it has not been found for a long time. who can help me to see it!
I set the condition that number = 512 only has one record that meets the condition in the database, but every time I traverse the output, all the data is output?
The cause cannot be found all the time.
PHP code
$ SQL = "select * from 'test' where number = 512"; $ sqlm = mysql_query ($ SQL); while ($ row = mysql_fetch_array ($ sqlm) {?> Name:
Gender:
Date of birth:
Age:
Current Residence:
Note:
------ Solution --------------------
You can print the SQL statement first. Then run the command in phpmyadmin to check whether the SQL statements are correct...
------ Solution --------------------
Execute your SQL statement in phpmyadmin
Post result
------ Solution --------------------
Number is in the varchar format.
The SQL statement should be $ SQL = "select * from 'test' where number = '000000 '";
------ Solution --------------------
The string must be enclosed in quotation marks, or you can change this field to the int type.