mysql5.5 hint Deprecated:mysql_query (): The MySQL extension is deprecated

Source: Internet
Author: User
Tags deprecated php error

From the wrong hint is not recommended to use the Mysql_connect function, and then I see from the official to say that later do not use the Mysql_connect function, recommended using MYSQLI or PDO to replace, know the reason to solve the convenience.

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

<?php
error_reporting = E_all & ~e_deprecated


Method 2: Disable PHP error

Display_errors = on changed 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 unsafe and too old.


Small Tips

The second method is a temporary solution, but it is also the most commonly used solution, now have n multiple programs are connected to the database with Mysql_connect Oh.

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.