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
我在我的电脑上配置了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
相关文章
相关视频
- 教你使用PHP数据库迁移工具“Phinx”
- 详解win10下PHP的安装配置(以php5.6为...
- php Swoole实现毫秒定时计划任务(详解)
- 解析php获取字符串的编码格式的方法(函数)_PH...
- The mysql extension is de...
上一篇: 如何使用帝国CMS的灵动标签e:loop_PHP教程
下一篇: Oracle 备份恢复概要介绍
推荐阅读
-
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO
-
The mysql extension is deprecated and will be removed in the future,这是什么原因啊?
-
The mysql extension is deprecated and will be removed in the future,这是什么原因啊解决方法
-
The mysql extension is deprecated and will be removed in the future,这是什么原因啊该如何解决
-
解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
-
解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in,pdomysqli
-
The mysql extension is deprecated and will be removed in the future,这是什么原因啊解决方法
-
The mysql extension is deprecated and will be removed in the future,这是什么原因啊解决方法
-
解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
-
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO