Query statements have errors, looking for a long time have not found, who help me to see!
I set the condition that number=512 only one record in the database that meets the criteria, but each traversal output outputs all the data?
have been unable to find the reason.
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 place of residence:
remark:
------Solution--------------------
You can first print the SQL statement first. And then put it in the phpMyAdmin to see if the SQL is wrong ...
------Solution--------------------
Execute your SQL in phpMyAdmin
Post the results
------Solution--------------------
Number is a varchar form.
The SQL statement should be $sql = "SELECT * from ' Test ' where number= ' 512 '";
------Solution--------------------
You must enclose the string in quotation marks, or you can change the field to an int type.