欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

The mysql extension is deprecated and will be removed in the future,这是什么原因啊解决方法

程序员文章站 2022-06-15 16:42:05
...
The mysql extension is deprecated and will be removed in the future,这是什么原因啊?
我在我的电脑上配置了2-plan-team这个系统,这是用PHP写的,配置完后,打开index.php,却出现以下问题:PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\server\2-plan-team\include\class.datenbank.php on line 38
class.datenbank.php的源代码:

/*
* The class datenbank (database) provides methods to handle a database connection
*
* @author original code from Open Dynamics.
* @name datenbank
* @version 0.4.6
* @package 2-plan
* @link http://2-plan.com
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License v3 or later
*/
class datenbank
{

/*
* Constructor
*/
function __construct()
{
}

/*
* Establish a database connection
*
* @param string $db Database name
* @param string $user Database user
* @param string $pass Password for database access
* @param string $host Database host
* @return bool
*/
function connect($db_name, $db_user, $db_pass, $db_host="localhost")
{

//mysql
//$db = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);

$conn = mysql_connect($db_host,$db_user,$db_pass);
$db_check = mysql_select_db($db_name);
if($db_check)
{
return true;
}
else
{
return false;
}
}

/*
* Wrap mysql_query function
The mysql extension is deprecated and will be removed in the future,这是什么原因啊解决方法

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频