Why can't I output the mysql_fetch_array () statement normally?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.