Database Connectivity Issues

Source: Internet
Author: User
The Wamp2.0 in the local test has changed the MySQL password. However, the site appears warning:mysql_query (): supplied argument is not a valid Mysql-link resource in ... The corresponding code is mysql_query ($sql, $link) or Die (Mysql_error ()); My profile has changed the password.


Reply to discussion (solution)

Obviously $link not a resource.

Look at the code above to connect MySQL, the user name and password are written to No.

Post specific code to see

It's all written right.

The code that shows the error is
mysql_query ($sql, $link) or Die (Mysql_error ()); Send SQL request to create member table @zy205817

What is the $link of the building?

$link =mysql_connect ($host, $user, $pass);

$link =mysql_connect ($host, $user, $pass) or Die (Mysql_error ());

Change or show this error

Put your code out.

Information has been changed in the configuration. But the database has no data, but I use the test file to display it correctly.

Look at the generation?? Yes??.

Since you use? File system that's right, you?? It's different than a little bit.

I want to see you from
$link =mysql_connect ($host, $user, $pass) or Die (Mysql_error ());
To error message Warning:mysql_query (): supplied argument is not a valid Mysql-link resource in ... Line number
The code between


So see no problem, you follow #14 posted code to see, and your require ' 20-1.php '; What is it?

1. Test MySQL connection with cmd
2. Write a PHP test for yourself, and a few lines of connection code

has been resolved, that is my space 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.