select * from $talbe
where (min_age <=$min_age and max_age>=$min_age)
or (min_age <=$max_age and max_age>=$max_age)
and class=$class order bye desc;
> 먼저 설명을 드리면
> 예를 들어 나이가 4~6세인 경우 min_age=4, max_6의 값을 넘겨서
> db에서 min_age나 max_age가 만족하면서 class='$class'를 만족시켜주는 값을 얻어내고자 합니다..
>
> $dbresult = mysql_query("select * from $table where min_age<='$min_age'<=max_age or min_age<='$m
> ax_age'<=max_age and class='$class' order by id desc",$dbconn);
>
> 이렇게 했더니.. 앞의 두 경우 min_age<='$min_age'<=max_age or min_age<='$max_age'<=max_age 의 결
> 과만 나오고 class='$class'는 만족시키지 않는 결과가 나옵니다..
>
> 어찌해야 하나요..??
|