i'm building a site utilizing PHP/MySQL. i'm querying a table to find records where a field lies within a certain range.
$age1 = "20"; $age2 = "30"; $sql = "select * from table where age>=$age1 and age<=$age2";
is there another way to write this query? i'm going to be building the sql string programmatically and i was curious about different syntax being able to produce the same result in the hopes that it'll help streamline my PHP code. for example, what if i don't know which is value is greater, age1 or age2? is there some sql syntax that will deal with this situation without me having to determine which is which via PHP?
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php