I use the following code to order the results of the query by the variable $order.

$result = mysql_query("SELECT 
articles.title,vote.votes,vote.total,articles.date,staff.firstname,articles.content,articles.id
 FROM staff,articles,vote WHERE articles.authorid = staff.id AND articles.id = 
vote.item ORDER BY `$order` DESC",$db);

I assign the variable a value according to my url, 
http://www.mysite.com/file.php?order=something

My question is. Is there a way of assigning the $order variable a default value? Like 
if they hit http://www.mysite.com/file.php without the order=something can I tell the 
script to assign $order a default value?

Thanks,
Nate

Reply via email to