Troubleshoot MySQL deprecated module error deprecated:mysql_query (): The MySQL extension is deprecated and'll be removed in the future

Source: Internet
Author: User
Tags deprecated php error

The MySQL 5.5 version was used today and there was an error. The error prompts are as follows:

Deprecated:mysql_connect (): The MySQL extension is Deprecated and would be a removed in the Future:use mysqli or PDO Instea D in

See the meaning is very clear, said mysql_connect This module will be deprecated in the future, please use MYSQLI or PDO to replace. So it should be more appropriate to say that this is a hint.

Now that you know what the cause of this error is, it's a good solution.

Solution 1: Set the alarm level in the PHP program code

<?phperror_reporting = E_all & ~e_deprecated

Method 2: Disable PHP error

Display_errors = on change to display_errors = Off

Method 3: Use Mysqli or PDO

We recommend that you cancel MySQL as soon as possible, all toward mysqli or PDO and so on. MySQL is really too insecure and too old.

Troubleshoot MySQL deprecated module error deprecated:mysql_query (): The MySQL extension is deprecated and'll be removed in the future

Related Article

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.