php用Uncaught Error: Call to undefined function mysql_connect()
Author:zhoulujun Date:
今天跑之前的老项目,服务器报500,尼玛!没有修改过啊。
然后本地跑下:
: Uncaught Error: Call to undefined function mysql_connect() in /www/demo/fuan/tool/ConnectDB.php:28 Stack trace: #0 /www/zhoulujun/demo/fuan/game.php(60): ConnectDB->connectDB() #1 {main} thrown in
百度下,然后修改php.ini 比如:
extension=php_mysql.dll
extension=php_mysqli.dll
如果你的ini文件未做过修改,每行前的开头会有一个分号,将其删除。
等等其他 配置修改……
然并卵
谷歌下:
You can use this code:
$db_con = mysqli_connect('localhost', 'root', 'password', 'db_name');
It is recommended to use either the mysqli or PDO_MySQL extensions. It is not recommended to use the old mysql extension for new development, as it was deprecated in PHP 5.5.0 and was removed in PHP 7. A detailed feature comparison matrix is provided below. The overall performance of all three extensions is considered to be about the same. Although the performance of the extension contributes only a fraction of the total run time of a PHP web request. Often, the impact is as low as 0.1%.
转载本站文章《php用Uncaught Error: Call to undefined function mysql_connect() 》,
请注明出处:https://www.zhoulujun.cn/html/php/phpBase/2017_0418_7989.html