Solution: Deprecated: mysql_connect (): Themysqlextensionisdeprecatedandwillberemovedinthefuture:

Source: Internet
Author: User
: This article describes how to solve Deprecated: mysql_connect (): Themysqlextensionisdeprecatedandwillberemovedinthefuture:. if you are interested in PHP tutorials, refer to it. Php 5 versions: 5.2, 5.3, 5.4, and 5.5. for fear of keeping up with the times, the new server directly goes to 5.5, but the program has the following error: Deprecated: mysql_connect (): the mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in the future, which means it is clear that The mysql_connect module will be unavailable in the future, use mysqli or PDO instead. Mysqli is more rigorous, secure, and efficient

Solution 1:

Disable php to report an error

Display_errors = On
Change
Display_errors = Off

Since this server is used by users, sometimes they need to report an error (... They are all for friends, ^ _ ^). you cannot do this. let them change the program. See solution 2.

Solution 2:

Error_reporting (E_ALL ^ E_DEPRECATED );

The preceding section describes how to solve Deprecated: mysql_connect (): the mysql extension is deprecated and will be removed in The future, if you are interested in PHP tutorials.

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.