提示信息:mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
我的源码是:
<?php
class mysql
{
protected $db_prefix;
protected $conn;
protected $distinct = '';
protected $where = '';
protected $table = '';
protected $field = '';
protected $order = '';
protected $limit = '';
protected $data = '';
protected $join = '';
public $select_count = 0;
public $last_sql = '';
public $lastInsID = 0;
public function __construct()
{
if (!function_exists('mysql_connect')) {
pigcms_tips('服务器空间PHP不支持MySql数据库', 'none');
}
global $_G;
$this->db_prefix = $_G['system']['DB_PREFIX'];
if (!$this->conn = @mysql_connect($_G['system']['DB_HOST'], $_G['system']['DB_USER'], $_G['system']['DB_PWD'])) {
switch ($this->geterrno()) {
case 2005:
pigcms_tips('连接数据库失败,数据库地址错误或者数据库服务器不可用', 'none');
break;
case 2003:
pigcms_tips('连接数据库失败,数据库端口错误', 'none');
break;
case 2006:
pigcms_tips('连接数据库失败,数据库服务器不可用', 'none');
break;
case 1045:
pigcms_tips('连接数据库失败,数据库用户名或密码错误', 'none');
break;
default:
pigcms_tips('连接数据库失败,请检查数据库信息。错误编号:' . $this->geterrno(), 'none');
break;
}
}
if ('4.1' < $this->getMysqlVersion()) {
mysql_query('SET NAMES \'utf8\'');
}
qq_放肆青春_03307463
诺亚慈航
这天
Caballarii