Warning </B>: mysql_free_result (): suppliedargumentisnotavalidMySQLresult

Source: Internet
Author: User
Tags mysql view
Warning & lt; B & gt;: mysql_free_result (): suppliedargumentisnotavalidMySQLresult what is the error?
 


The connection is successful, but this error is reported ..
Database connected!
Warning: Mysql_free_result (): supplied argument is not a valid MySQL result resource inF: \ environment \ WAMP \ wamp5 \ wamp \ www \ test \ SQL. phpOn line17

Warning: Mysql_close (): supplied argument is not a valid MySQL-Link resource inF: \ environment \ WAMP \ wamp5 \ wamp \ www \ test \ SQL. phpOn line18


Reply to discussion (solution)

$ Result = mysql_query ($ SQL );
Change
$ Result = @ mysql_query ($ SQL) or die (mysql_error ());

$ Result = mysql_query ($ SQL );
Change
$ Result = @ mysql_query ($ SQL) or die (mysql_error ());



No database selected is displayed on the webpage. is this database not found?
However, I am using the Navicat 8 for mysql View tool.
I have created a database and a resume. How can I query the tables in this database?

You only connect to the database system, but do not select the database to be operated
Mysql_select_db ('database name ');
Otherwise, how do you know that you are querying the user table in that database?

In addition, your mysql_close ($ conn) is in the function, and $ conn is not passed to the function.
So there will be 2nd errors

Perfect answers from moderators


$ Result = mysql_query ($ SQL );
Change
$ Result = @ mysql_query ($ SQL) or die (mysql_error ());



No database selected is displayed on the webpage. is this database not found?
However, I am using the Navicat 8 for mysql View tool.
I have created a database and a resume. How can I query the tables in this database?



You do not have mysql_select_db before mysql_query. mysql does not know which database you need to perform the query operation.

After creating a connection, add one sentence
@ Mysql_select_db ('Enter the database name here ', $ conn) or die (mysql_error ());

 

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.