Re: Query help

From: Date: Fri, 09 Jul 2004 15:46:28 +0000
Subject: Re: Query help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-35178@lists.php.net to get a copy of this message
I think you want: "SELECT * FROM routes, users WHERE area='$area' AND style='$style' AND rating BETWEEN '[$rating1]' AND '[$rating2]' GROUP BY route ORDER BY rating ASC "; From http://dev.mysql.com/doc/mysql/en/Comparison_Operators.html "expr BETWEEN min AND max If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= max) if all the arguments are of the same type. Otherwise type conversion takes place according to the rules described at the beginning of this section, but applied to all the three arguments. Note: Before MySQL 4.0.5, arguments were converted to the type of expr instead."

« previous php.db (#35178) next »