이상이하 검색

이상이하 검색

QA

이상이하 검색

답변 1

본문

제가 그누 Q&A를 비롯해 어제 책도 사서 보면서 만든 조합인데...

이거 아닌가바요.. 왜 안되는가요 ? ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ

정말 고수님 좀 알려주세요 ~!

이걸 리스트에 그냥 넣었거든용  wr_1  wr_10  까지 검색은 잘되요

value="10"  이렇게 하면 잘 찾아와요 

 

<?

 

$where = "";

 

for($i = 1; $i <= 5; $i++) if($age == "$i") $age[$i] = "selected"; 

 

if ($age[1] =  "wr_1 <= 10") ;

if ($age[2] =  "wr_1 >= 10 and wr_1 <= 20" ) ;

if ($age[3] =  "wr_1 >= 20 and wr_1 <= 30" ) ;

if ($age[4] =  "wr_1 >= 30 and wr_1 <= 40" ) ;

if ($age[5] =  "wr_1 >= 40 and wr_1 <= 50" ) ;

 

$Query = "select * from table where wr_1 between $age[$i] and $age[$i]";

 

?>

 

 

<select name="wr_1">

<option value="">-- 나이 --</option>

<option value="<?=$age[1]?>">10 이하</option>

<option value="<?=$age[2]?>">10~20</option>

<option value="<?=$age[3]?>">20~30</option>

<option value="<?=$age[4]?>">30~40</option>

<option value="<?=$age[5]?>">40~50</option>

</select>

 

 

 

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,112
© SIRSOFT
현재 페이지 제일 처음으로