여분필드 검색 오류

여분필드 검색 오류

QA

여분필드 검색 오류

본문

search.php에

 

if ($it_stand) 
    $where[] = " it_4 = '$it_4' ";

 

를 추가하고

 

$query_string .= '&qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qtag='.$qtag.'&amp';'it_stand='.$it_4.'&amp';

 

를 추가하고

 

seach.skin에

 

<input type="hidden" name="it_stand" id="it_stand" value="<?php echo $it_stand ?>">

 

<input type="radio" name="it_stand" value="" id="it_stand0" <?php echo get_checked($it_stand, ''); ?>>
<label for="it_stand0">전체</label>
<input type="radio" name="it_stand" value="yes" id="it_stand1" <?php echo get_checked($it_stand, 'yes'); ?>>
<label for="it_stand1">스탠드형</label>
<input type="radio" name="it_stand" value="no" id="it_stand2" <?php echo get_checked($it_stand, 'no');  ?>>
<label for="it_stand2">비스탠드형</label>

 

를 추가했습니다.

 

전체를 선택하면 제대로 나오는데 스탠드형이나 비스탠드형을 선택시 아무것도 안나옵니다 ㅠㅠ

 

무엇이 잘못됐나요?

 

여분필드 4번 항목입니다. 

이 질문에 댓글 쓰기 :

답변 7

echo $sql;

exit;

로 $sql문을 찍어보시길 바랍니다.

 

소스를 보니 implode하면서 and를 자동으로 붙여주는군요.ㅎ

 

아.. 이전에 달았던 댓글은 잊어버리세요. 소스를 보니 필요없네요. 자동으로 and를 붙여줘서..ㅎㅎ 

select COUNT(*) as cnt from g5_shop_item a, g5_shop_category b where (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) and it_4 = '' 

 

이렇게 구문이 나오면 문제없을 것 같네요.

 

데이터 가져오는 부분도 찍어봐주세요. 

궁금한것이...

it_stand가 it_4에 저장되어있는 건가요?

 

그러면 ​

 

$it_4 = $_REQUEST['it_stand'];

if ($it_4
    $where[] = " it_4 = '$it_4' "; ​

 

이렇게 수정해보세요.​ 

아...긍데...html문도 오류가 있는 것같네요.

 

<input type="hidden" name="it_stand" id="it_stand" value="<?php echo $it_stand ?>">

 

<input type="radio" name="it_stand" value="" id="it_stand0" <?php echo get_checked($it_stand, ''); ?>>
<label for="it_stand0">전체</label>
<input type="radio" name="it_stand" value="yes" id="it_stand1" <?php echo get_checked($it_stand, 'yes'); ?>>
<label for="it_stand1">스탠드형</label>
<input type="radio" name="it_stand" value="no" id="it_stand2" <?php echo get_checked($it_stand, 'no');  ?>>
<label for="it_stand2">비스탠드형</label>

 

같은이름을 가진 input이 2개잖아요. (라디오하고 히든)

<input type="hidden" name="it_stand" id="it_stand" value="<?php echo $it_stand ?>"> 이거 지우세요. 

정리하자면 it_4 에 'yes', 'no'가 들어있단 말이죠?

 

$it_4 = $_REQUEST['it_stand'];

if ($it_4
        $where[] = " it_4 = '$it_4' "; ​

 

​$query_string .= '&qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qtag='.$qtag.'&it_stand='.$it_4;

 

​<input type="radio" name="it_stand" value="" id="it_stand0" <?php echo get_checked($_GET['it_stand'], ''); ?>>
<label for="it_stand0">전체</label>
<input type="radio" name="it_stand" value="yes" id="it_stand1" <?php echo get_checked($_GET['it_stand'], 'yes'); ?>>
<label for="it_stand1">스탠드형</label>
<input type="radio" name="it_stand" value="no" id="it_stand2" <?php echo get_checked($_GET['it_stand'], 'no');  ?>>
<label for="it_stand2">비스탠드형</label>
 

답변을 작성하시기 전에 로그인 해주세요.
전체 16,797
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT