Hi I was wondering if someone could help me please? I need to add the ORDER BY option of my query to be a $variable so a user can choose (by either using a drop down menu or hitting hyperlink) to determine how the outputted results will be ordered. I don't know how to do this, if someone could help that would be ace.
$sql4 = mysql_query("SELECT media.*, IF (ISNULL(rating.ip), 0, 1) AS HasRated
FROM media LEFT JOIN rating ON media.media_id = rating.media_id AND rating.ip = '".$ipaddress."'
WHERE media.media_type = 'Book' ORDER BY $variable $limit");
Thank you