mysqli_FETCH_Array()期望參數1為mysqli_test,布爾值在中給出。我在檢查數據庫中是否已經存在Facebook user_id時遇到了一些困難(如果沒有,那么應該接受用戶作為一個新用戶,否則只需加載畫布應用程序)。我在我的托管服務器上運行它,沒有問題,但是在本地主機上它給出了以下錯誤:mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in這是我的密碼:<?$fb_id = $user_profile['id'];$locale = $user_profile['locale'];if ($locale == "nl_NL") {
// Checking User Data @ WT-Database
$check1_task = "SELECT * FROM `users` WHERE `fb_id` = " . $fb_id . " LIMIT 0, 30 ";
$check1_res = mysqli_query($con, $check1_task);
$checken2 = mysqli_fetch_array($check1_res);
print $checken2;
// If the user does not exist @ WT-Database -> insert
if (!($checken2)) {
$add = "INSERT INTO users (fb_id, full_name, first_name, last_name, email)
VALUES ('$fb_id', '$full_name', '$first_name', '$last_name', '$email')";
mysqli_query($con, $add);
}
// Double-check, the user won't be able to load the app on failure inserting to the database
if (!($checken2)) {
echo "Excuse us " . $first_name . ". Something went terribly wrong! Please try again later!";
exit;
}} else {
include ('sorrylocale.html');
exit;}我讀過它與我的查詢錯誤有關,但是它已經在我的主機提供商上工作了,所以不可能是它!
添加回答
舉報
0/150
提交
取消