$query = "select q.item_id_q, q.q_id, q.username,
review_items.item_name, q.q_date, review_items.item_id, q.priority
FROM review_items, q WHERE review_items.inventory != 0 AND q.item_id_q = review_items.item_id
GROUP BY q.q_date
ORDER BY q.q_date, q.username, q.priority";
The query above does everything I want it to but it does NOT order the output by priority.
How can I rewrite this to make it group by the date and then within those groups, order by date (oldest first), username and priority (numerical field) from low to high.
$query = "select q.item_id_q, q.q_id, q.username,
review_items.item_name, q.q_date, review_items.item_id, q.priority
FROM review_items, q WHERE review_items.inventory != 0 AND q.item_id_q = review_items.item_id
GROUP BY q.q_date
ORDER BY q.q_date DESC, q.username DESC, q.priority ASC";
add DESC, ASC at the end of the variables you are wanting to order by if you use more than 1 field.
Unfortunately, that didn't sort the priority column.
Any other ideas?
Thanks,
Tim
The only other help I can give you would be the ORDER_BY examples in the MySQL manaual. I've ran into this same issue in the past myself. I can't remember how I sorted it out for the life of me.