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
提交
取消