Solution Deprecated:mysql_connect (): The MySQL extension is deprecated and would be removed in the future:

Source: Internet
Author: User
Tags deprecated php error

Mysqli more rigorous, safe and efficient

PHP 5 version, 5.2, 5.3, 5.4, 5.5, afraid to keep up with the times, the new server directly on the 5.5, but the program appears the following error: Deprecated:mysql_connect (): The MySQL extension is Deprecated And will is removed in the Future:use mysqli or PDO instead in the future, see the meaning is very clear, said mysql_connect This module is going to be deprecated, please use MYSQLI or P do to replace.

Workaround 1:

Prohibit PHP error

Display_errors = On
Switch
Display_errors = Off

Since this server is for users, sometimes they need to make an error (...). Are for friends, ^_^), can not do this, let them change the program bar, see Program 2.

Workaround 2:

<?php
Error_reporting (e_all ^ e_deprecated);

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.