ADODB mySQLi连接 [英] ADODB mySQLi Connection
本文介绍了ADODB mySQLi连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将mysql与adodb一起使用,如果要转移到mysqli,我必须做些什么更改。
I am using mysql with adodb and what changes i have to do if i want to shift to mysqli.
这是我的连接文件,我需要进行更改仅在此文件中,否则我必须更新我的所有查询文件。
this is my connection file and i need to make changes in this file only or i have to update all my query files.
include_once("adodblib/adodb.inc.php");
class ADb {
function ADb()
{
global $dbserver;
global $dbuser;
global $dbpass;
global $database;
$dbuser = "root";
$dbpass = "asdasdasd";
$dbserver = "localhost";
$database = "DB_NAME";
$this->conn1 = &ADONewConnection('mysql');
$this->conn1->PConnect($dbserver, $dbuser, $dbpass, $database);
}
function query($sql){
$Result = $this->conn1->Execute($sql);
return $Result;
}
function ExecuteQuery($sql){
$Result = $this->conn1->Execute($sql);
return $Result;
}
function ExecuteQuery1($sql){
return $this->query($sql);
}
function Execute($sql){
return $this->query($sql);
}
}
推荐答案
您只需将ADONewConnection的参数更改为mysqli。
You just need to change the parameter of ADONewConnection to mysqli.
更改行
$this->conn1 = &ADONewConnection('mysql');
到
$this->conn1 = &ADONewConnection('mysqli');
这篇关于ADODB mySQLi连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文