Jump to content

SQL Query problem


xyn

Recommended Posts

Hey,
I have a case script in SQL so that NEW private Messages
are always ordered at the top, then everything else which is
read are listed under-neath, but the problem with this is
everything is NOT in date order, which is confusing me...
I basically wanted new messages at the top in order of
DATE descending. but everything else under that is randomly
ordered...

my code:
SELECT id,fr_usr,subject,stats,date,time,
CASE WHEN stats='3' THEN 1 WHEN stats='0' THEN 2 ELSE 3 END as pmsort
FROM pm
WHERE to_usr='{$_SESSION['username']['usr_user']}'
ORDER BY pmsort,date DESC

Any ideas?
Link to comment
https://forums.phpfreaks.com/topic/27025-sql-query-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.