Code: Select all
//take results and customize them for query value insert
while ($row = mysql_fetch_array($result2, MYSQL_ASSOC))
{
$strquery .= " ".$row["zipcode"].", ";
}
//take list and stop the , at end of query insert
$strquery = rtrim($strquery, ', ');
then I insert them here and it works great.
Code: Select all
$query = "select * from Table where ZipCode IN (".$strquery.") order by Value";
My results currently display zip codes in ascending order like this. (21032, 21123, 21144, 21146) low to high
How can I get the query to display results in the results order above. (21146, 21032, 21123, 21144)
My thought was something like this but it breaks when I use it..
Code: Select all
$query = "select * from Table where ZipCode IN (".$strquery.") order by Value, ZipCode [(".$strquery.")]";