체크박스 이용 검색 만들때 sql 문 문의드립니다. 정보
체크박스 이용 검색 만들때 sql 문 문의드립니다.본문
체크박스가 몇개 있고 그 값들이 zcode1 ~ zcode10 까지 있다고 가정하에
필드는 zcode1 ~ zcode10 이렇게 있습니다. 각 각의 필드안에 값들이 들어있고
중복체크해서 sql 문을 만들려고 하니 잘 안되네요 ㅜㅜ
and 를 써도 안되고 or 도 안되고...
and 를 사용하니 zcode1 에는 있는데 zcode2 에 없으니 출력이 안되네요.. ㅜㅜ
------------------------------------
$sql_search = " where a.mb_id = b.mb_id and b.mp_last_date >= '$g4[time_ymd]' ";
if ($stx) {
$sql_search .= " and zcode1 = '서울' ";
$sql_search .= " and zcode2 = '인천' ";
$sql_search .= " and zcode3 = '경기' ";
}
-----------------------------------------------------------------------
위와 같은 방식인데요 ㅜㅜ 예를들어 서울 체크 인천 체크 하면 서울 하고 인천이 포함된 것들이
쫙 나왔으면 하거든요 sql 문 좀 부탁드립니다... 흑흑..
필드는 zcode1 ~ zcode10 이렇게 있습니다. 각 각의 필드안에 값들이 들어있고
중복체크해서 sql 문을 만들려고 하니 잘 안되네요 ㅜㅜ
and 를 써도 안되고 or 도 안되고...
and 를 사용하니 zcode1 에는 있는데 zcode2 에 없으니 출력이 안되네요.. ㅜㅜ
------------------------------------
$sql_search = " where a.mb_id = b.mb_id and b.mp_last_date >= '$g4[time_ymd]' ";
if ($stx) {
$sql_search .= " and zcode1 = '서울' ";
$sql_search .= " and zcode2 = '인천' ";
$sql_search .= " and zcode3 = '경기' ";
}
-----------------------------------------------------------------------
위와 같은 방식인데요 ㅜㅜ 예를들어 서울 체크 인천 체크 하면 서울 하고 인천이 포함된 것들이
쫙 나왔으면 하거든요 sql 문 좀 부탁드립니다... 흑흑..
Fatal error: Uncaught TypeError: mysqli_fetch_assoc(): Argument #1 ($result) must be of type mysqli_result, null given in /home/kagla/new-sir/old/lib/common.lib.php:2339 Stack trace: #0 /home/kagla/new-sir/old/lib/common.lib.php(2339): mysqli_fetch_assoc() #1 /home/kagla/new-sir/old/skin/board/v16/view.skin.php(795): sql_fetch_array() #2 /home/kagla/new-sir/old/bbs/view.php(403): include_once('...') #3 /home/kagla/new-sir/old/bbs/board.php(300): include_once('...') #4 {main} thrown in /home/kagla/new-sir/old/lib/common.lib.php on line 2339