This one has been puzzling me for some time... If you have a table where 'type' column could be 'f','m','t' is there a way to use something like (this doesn't work...)
Code: Select all
SELECT * FROM contacts WHERE cust_id=66 ORDER BY type ('t','f','m');Code: Select all
$_SESSION['locs']=array('loc1'=>distance,'loc2'=>distance);
asort($_SESSION['locs'];
$locs=implode(',',array_keys($_SESSION['locs']));
$sql="SELECT * FROM table WHERE location IN ({$locs}) ORDER BY ({$locs});