我有此mysql代码,我需要转换为mysqli,但是我遇到了问题并出现了空白页。 这是我的最终代码
<?php
require_once 'config.php';
$dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass, $dbName) or die ('MySQL connect failed. ' . mysql_error());
mysqli_select_db($dbConn, $dbName) or die('Cannot select database. ' . mysqli_error());
function dbQuery($dbConn, $sql)
{
$result = mysqli_query($dbConn, $sql) or die(mysqli_error());
return $result;
}
function dbAffectedRows()
{
global $dbConn;
return mysqli_affected_rows($dbConn);
}
function dbFetchArray($result, $resultType = MYSQL_NUM) {
return mysqli_fetch_array($result, $resultType);
}
function dbFetchAssoc($result)
{
return mysqli_fetch_assoc($result);
}
function dbFetchRow($result)
{
return mysqli_fetch_row($result);
}
function dbFreeResult($result)
{
return mysqli_free_result($result);
}
function dbNumRows($result)
{
return mysqli_num_rows($result);
}
function dbSelect($dbConn, $dbName)
{
return mysqli_select_db($dbConn, $dbName);
}
function dbInsertId()
{
return mysqli_insert_id();
}
?>
有人可以帮我吗?它有什么问题,我该如何解决? 提前致谢。 .....