PHP error Warning:mysql_query () workaround, warningmysql_query_php tutorial

Source: Internet
Author: User
Tags php error

PHP error Warning:mysql_query () workaround, Warningmysql_query


PHP prompt Error: warning:mysql_query () [Function.mysql-query]: Access denied for user ' ODBC ' @ ' localhost ' (using Password:no)
Code:

Reason:
Mysqlclass the second beginning of the Mysqlclass, first the first to make the same $this->link, and then call the __CONSTRUCT function will shut down this->link.
Finally, the MySQL resource in $db is empty and the error pops up.
Workaround:
$db = $db? $db: New Mysqlclass ();
Or
$this->link=mysql_connect ($host, $user, $PW, true);

Hope to provide a solution that can really help everyone.

http://www.bkjia.com/PHPjc/1063894.html www.bkjia.com true http://www.bkjia.com/PHPjc/1063894.html techarticle PHP Error Warning:mysql_query () workaround, warningmysql_query PHP hint error: warning:mysql_query () [Function.mysql-query]: Access denied for user ' ODBC ' @ ' localhost ' (using P ...

  • 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.