D:\website\pack_201812120_58530\wwwroot\Appwork\Lib\Driver\Db\DbMysql.class.php LINE: 58
错误位置
46 if ( !isset($this->linkID[$linkNum]) ) { 47 if(empty($config)) $config = $this->config; 48 // 处理不带端口号的socket连接情况 49 $host = $config['hostname'].($config['hostport']?":{$config['hostport']}":''); 50 // 是否长连接 51 $pconnect = !empty($config['params']['persist'])? $config['params']['persist']:$this->pconnect; 52 if($pconnect) { 53 $this->linkID[$linkNum] = mysql_pconnect( $host, $config['username'], $config['password'],131072); 54 }else{ 55 $this->linkID[$linkNum] = mysql_connect( $host, $config['username'], $config['password'],true,131072); 56 } 57 if ( !$this->linkID[$linkNum] || (!empty($config['database']) && !mysql_select_db($config['database'], $this->linkID[$linkNum])) ) { 58 throw_exception(mysql_error()); 59 } 60 $dbVersion = mysql_get_server_info($this->linkID[$linkNum]); 61 //使用UTF8存取数据库 62 mysql_query("SET NAMES '".C('DB_CHARSET')."'", $this->linkID[$linkNum]); 63 //设置 sql_model 64 if($dbVersion >'5.0.1'){ 65 mysql_query("SET sql_mode=''",$this->linkID[$linkNum]); 66 } 67 // 标记连接成功 68 $this->connected = true; 69 // 注销数据库连接配置信息 70 if(1 != C('DB_DEPLOY_TYPE')) unset($this->config);