I currently have two queries:
// This first query simply selects all the "items" from the item table.
$sql=safe_query("SELECT * FROM items");
// If a user adds an item it gets put in the "added_items" table. So this query selects all the users which have added the item in question.
// This query is within the "foreach" loop....
$number=safe_query("SELECT * FROM added_items WHERE item='$itemid'");
// So with this I can show: Item name (number of adds)
My question: I would like to order the items based on the number of adds. Any help?