I have variables coming from a query string (don't worry I did it safely). Please advise me how I can add the variables to my sql query. My variables:
$order = "ASC";
if(isset($_POST['sort'])){
if($_POST['sort']=="date"){
$sort = "date";
}
else if($_POST['sort']=="pricelow"){
$sort = "Price";
}
else if($_POST['sort']=="pricehigh"){
$sort = "Price";
$order = "DESC";
}
}
And my query below:
mysql_query("SELECT * FROM event ORDER BY '$sort' '$order'");