My height code is as follows:
Include ("conn. php ");
If (! Empty ($ _ GET ['id']) {
$ SQL = "select * from news where 'id' = '". $ _ GET ['id']. "'";
$ Query = mysql_query ($ SQL );
$ Rs = mysql_fetch_array ($ query );
}
Error Message
Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in F: xmappwww. bKjia. c0mmylibrarysearch_result.php on line 32
Then I upgraded the code.
If (! Empty ($ _ GET ['id']) {
$ SQL = "select * from news where 'id' = '". $ _ GET ['id']. "'";
$ Query = mysql_query ($ SQL );
If (mysql_num_rows ($ query)
{
$ Rs = mysql_fetch_array ($ query );
}
Else
{
Mysql_error ();
}
}
In this way, the mysql error message is displayed. The result is that the SQL statement is faulty. Modify the SQL statement,
The compilation of the one-click tutorials prompts you that this type of errors is caused by our non-standard syntax. If you want to handle these errors, you can only output the SQL statements one by one or in mysql_query (SQL) or die (mysql_error ()) in this way to deal with site original reprint must indicate the source of http://www.bKjia. c0m/phper/php.html