Why cannot I output the mysql_fetch_array () statement normally? & Lt ;? Php $ conn = @ mysql_connect ("localhost", "root", "") & nbsp; or & nbsp; die & nbsp; ("link error "); mysql_select_db ("newdb" Why does my mysql_fetch_array () statement fail to be output normally?
$ Conn = @ mysql_connect ("localhost", "root", "") or die ("link error ");
Mysql_select_db ("newdb", $ conn );
$ SQL = "SELETE * FROM test ";
$ Query = mysql_query ($ SQL, $ conn );
$ Array = mysql_fetch_array ($ query );
Print_r ($ array );
?>
Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource in D: \ WAMP5 \ wamp \ www \ test \ file. php on line 6
MySQL php
------ Solution --------------------
$ SQL = "SELECT * FROM test ";
------ Solution --------------------
Supplied argument is not a valid MySQL result resource parameter is not a MYSQL result resource
That is, your SQL statement execution is faulty.
------ Solution --------------------
SELETE * FROM test
Change
SELECT * FROM test
------ Solution --------------------
The encoding is not uniform. what encoding is used for your table?
Mysql_query ("set name your code ");
The browser encoding must be consistent.