모바일에서 장바구니 담기 에러
관련링크
본문
http://www.butterfly-korea.co.kr/shop/shop/index.php?device=mobile
아이디 test1
비밀번호 1234
로 로그인해서 장바구니 담으려고 하면,
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/hosting_users/to_love58/www/shop/lib/common.lib.php on line 1563
- 장바구니에 담긴 상품이 없습니다.
이렇게 나오는데, 무슨 문제 인가요?
function sql_num_rows($result)
{
if(function_exists('mysqli_num_rows') && G5_MYSQLI_USE)
return mysqli_num_rows($result); // << 이부분이 1563 번째 줄인데 무슨 이윤지 모르겠네요. ㅜㅜ
else
return mysql_num_rows($result);
}
답변 2
위 오류는 mysql_query 결과를 mysqli_num_rows 함수에 넘겨줄 때 발생합니다.
코드 상에서 $result = mysql_query($sql); 와 유사한 코드가 있는지 확인해 보시기 바랍니다.
또는 쿼리문에 오류가 있어 결과값이 false 등일 때도 발생할 수 있습니다.
이 때는 sql_query($sql, true); 와 같이 수정하여 쿼리 오류를 확인할 수 있습니다.
mysql_num_rows($result); 함수 앞 부분에 @mysql_num_rows($result);
해보세요
해당 함수의 결과값을 bool 타입으로 이용해서 그런듯하네요
해보세요
해당 함수의 결과값을 bool 타입으로 이용해서 그런듯하네요
답변을 작성하시기 전에 로그인 해주세요.