장바구니 오류 채택완료
경주빵
1년 전
조회 1,992
안녕하세요~!
쇼핑몰 셋팅 후 나중에 보니까 장바구니 오류가 있었습니다.
파일을 다시 셋팅해도 같은 오류가 노출됩니다.
전에는 셋팅할때 이런 문제가 없었는데 뭐가 문제인지 알 수 있을까요?
내용 :
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in /도메인/lib/common.lib.php on line 1845
http://sir.kr/data/editor/2403/1935533572_1710397990.3224.png" width="100%" />
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
플라이
Expert
1년 전
참고 주소 보시고 체크해 보세요
참고 https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_function&wr_id=462547
로그인 후 평가할 수 있습니다
답변에 대한 댓글 3개
�
경주빵
1년 전
�
플라이
1년 전
이걸로만은 확인이 불가하고요 $result 값이 제대로 전달되는지등 확인해 봐야 합니다.
�
경주빵
1년 전
아하 그렇군요 ㅠ 감사합니다.
댓글을 작성하려면 로그인이 필요합니다.
1년 전
common.lib.php를 봐서는 안되고 shop/cart.php에서 sql_num_rows를 사용하는 곳을 찾아보세요
저 함수를 사용하는 곳이 없는 것 같은데...
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
경주빵
1년 전
shop/cart.php 에서 sql_num_rows를 사용하는 부분은
<?php
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
a.ct_send_cost,
a.it_sc_type,
b.ca_id
from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.od_id = '$s_cart_id' ";
$sql .= " group by a.it_id ";
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$cart_count = sql_num_rows($result); // 이부분입니다.
?>
<?php if($cart_count) { ?>
<div id="sod_chk" class="all_chk">
<input type="checkbox" name="ct_all" value="1" id="ct_all" checked>
<label for="ct_all"><span class="chk_img"></span> 전체선택</label>
</div>
<?php } ?>
이렇게 있습니다.
<?php
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
a.ct_send_cost,
a.it_sc_type,
b.ca_id
from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.od_id = '$s_cart_id' ";
$sql .= " group by a.it_id ";
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$cart_count = sql_num_rows($result); // 이부분입니다.
?>
<?php if($cart_count) { ?>
<div id="sod_chk" class="all_chk">
<input type="checkbox" name="ct_all" value="1" id="ct_all" checked>
<label for="ct_all"><span class="chk_img"></span> 전체선택</label>
</div>
<?php } ?>
이렇게 있습니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
혹시 해당 코드를 보면 알 수 있을까요?
(/도메인/lib/common.lib.php on line 1845)
function sql_num_rows($result)
{
if(function_exists('mysqli_num_rows') && G5_MYSQLI_USE)
return mysqli_num_rows($result); // 1845번줄
else
return mysql_num_rows($result);
}