Warning</b>: Mysql_free_result (): supplied argument is not a valid MySQL result

Source: Internet
Author: User
Tags mysql view
What's wrong with that?
 
  


The connection has been shown to be successful, but the error is reported.
Connect to the database successfully!
Warning: F:\environment\WAMP\wamp5\wamp\wamp\www\test\sql.php

Warning: F:\environment\WAMP\wamp5\wamp\wamp\www\test\sql.php


Reply to discussion (solution)

$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());

$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());



The Web page shows the No database selected, this is not found this databases?
But I'm using the Navicat 8 for MySQL view tool.
I am here to create the database and resume the table. How should I query the tables in this database?

You only connected to the database system, but did not select the database to operate
mysql_select_db (' Library name ');
How else do you know that you are querying the user table in that library?

In addition, your mysql_close ($conn) is in the function, and the $conn is not passed to the function.
So there's going to be a 2nd mistake.

The moderator answers the perfect


$result = mysql_query ($sql);
Switch
$result = @mysql_query ($sql) or Die (Mysql_error ());



The Web page shows the No database selected, this is not found this databases?
But I'm using the Navicat 8 for MySQL view tool.
I am here to create the database and resume the table. How should I query the tables in this database?



You don't have mysql_select_db,mysql before mysql_query. You do not know which db you need to perform the query operation.

After creating the connection, add a sentence
@mysql_select_db (' Fill in 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.