On Fri, Jul 09, 2004 at 09:39:02AM -0500, Craig Hoffman wrote:
> Style: Traditional
> Area: Yosemite
> Rating: From: 5.5 To: 5.10c
...
> "SELECT * FROM routes, users WHERE area='$area' AND style='$style'
> BETWEEN rating='[$rating1]' AND rating='[$rating2]' GROUP BY route
> ORDER BY rating ASC ";
>
> For some reason which I am not seeing, this query is not doing what it
> should be doing. Does anyone have any suggestions?
For starters your between syntax isn't correct (but is parsable in
ways you didn't want). You probably want:
select *
from routes, users
where area = '$area' and
style = '$style' and
rating between '$rating1' and '$rating2'
group by route
order by rating
As others have pointed out, your ratings aren't something MySQL will
know how to order. That's a separate problem (and more difficult to
solve), but the between syntax is also one.
--Pete
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]