Fatal error: Call to undefined function mysqli_result()如何修正

自從mysql5.0版以後,語法上就要求mysql改寫成mysqli下面是我的內容,它一直出現
Fatal error: Call to undefined function mysqli_result() in /home/shizhu/public_html/login.php on line 100
我實在不明白是要修改那方面?


// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER;
if (isset($_GET)) {
$_SESSION = $_GET;
}

if (isset($_POST)) {
$loginUsername=$_POST;
$password=$_POST;
$MM_fldUserAuthorization = "level";
$MM_redirectLoginSuccess = "loginmember.php";
$MM_redirectLoginFailed = "login.php?error=您登入帳號輸入錯誤";
$MM_redirecttoReferrer = false;
mysqli_select_db( $renewal,$database_renewal);

$LoginRS__query=sprintf("SELECT mail, password, level FROM customer WHERE mail=%s AND password=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

$LoginRS = mysqli_query($renewal,$LoginRS__query) or die(mysqli_error($error));
$loginFoundUser = mysqli_num_rows($LoginRS);

if ($loginFoundUser) {

$loginStrGroup = mysqli_result($LoginRS,0,'level');

//declare two session variables and assign them
$_SESSION = $loginUsername;
$_SESSION = $loginStrGroup;

if (isset($_SESSION) && false) {
$MM_redirectLoginSuccess = $_SESSION;
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}

可否協助我知道要如何修改......感謝...

似乎一直指以下的寫法有問題

$LoginRS = mysqli_query($renewal,$LoginRS__query) or die(mysqli_error($error));
$loginFoundUser = mysqli_num_rows($LoginRS);

if ($loginFoundUser) {

$loginStrGroup = mysqli_result($LoginRS,0,'level');


但我不明白那裡有問題....
Sign In or Register to comment.