채택완료

이상이하 검색

2016-12-25 (일) 12:40:24 3,528

제가 그누 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개

채택된 답변
+20 포인트

먼가 착가하고 계신듯 한데요.. ㅡㅡa 

일단 $Query를 echo $Query 로 출력해서 문제점을 확인해보세요

답변을 작성하려면 로그인이 필요합니다.