相关疑难解决方法(0)

如何将mysql更改为mysqli?

根据下面的代码,我用于常规的mysql,我怎么能将它转换为使用mysqli?

是否像更改**mysql _query($ sql)一样简单 ; 到mysqli _query($ sql) ; ?**

<?PHP

//in my header file that is included on every page I have this
$DB["dbName"] = "emails";
$DB["host"] = "localhost";
$DB["user"] = "root";
$DB["pass"] = "";
$link = mysql_connect($DB['host'], $DB['user'], $DB['pass']) or die("<center>An Internal Error has Occured. Please report following error to the webmaster.<br><br>".mysql_error()."'</center>");
mysql_select_db($DB['dbName']);
// end header connection part

// function from a functions file that I run a mysql query through in any page.
function executeQuery($sql) { …
Run Code Online (Sandbox Code Playgroud)

php mysql mysqli

53
推荐指数
7
解决办法
13万
查看次数

标签 统计

mysql ×1

mysqli ×1

php ×1