반응형
mysqli_builen_array()는 파라미터 1이 mysqli_result(부울값)이 될 것으로 예상합니다.
Facebook User_id가 이미 데이터베이스에 존재하는지 확인하는 데 어려움이 있습니다(존재하지 않으면 사용자를 새 사용자로 받아들이고 캔버스 애플리케이션을 로드합니다).호스팅 서버에서 실행했는데 문제가 없었는데 localhost에서 다음 오류가 나타납니다.
mysqli_builen_array()는 파라미터 1이 mysqli_result(부울값)이 될 것으로 예상합니다.
제 코드는 다음과 같습니다.
<?
$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;
}
내 쿼리가 잘못된 것과 관련이 있다고 읽었는데 호스팅 프로바이더에게 효과가 있어서 그럴 리가 없어요!
에 주어지는 쿼리mysqli_query()실패하여 돌아오고 있다false.
다음에 붙여주세요mysqli_query()무슨 일인지 알아봐야지
if (!$check1_res) {
printf("Error: %s\n", mysqli_error($con));
exit();
}
상세한 것에 대하여는, 다음을 참조해 주세요.
http://www.php.net/manual/en/mysqli.error.php
언급URL : https://stackoverflow.com/questions/15439919/mysqli-fetch-array-expects-parameter-1-to-be-mysqli-result-boolean-given-in
반응형
'itsource' 카테고리의 다른 글
| 해시 '#'이 없는 AngularJS 라우팅 (0) | 2022.09.25 |
|---|---|
| 판다는 머리털이 없는 테이블에서 책을 읽는다. (0) | 2022.09.25 |
| 정적 메모리 할당과 동적 메모리 할당의 차이 (0) | 2022.09.25 |
| composition api에서 vuex 모듈 getter를 사용하는 방법 (0) | 2022.09.25 |
| REST API에 대한 Larabel DB 쿼리가 매우 느립니다. (0) | 2022.09.25 |