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