You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY msg_time DESC’ at line 1
Failed query: SELECT msg_id FROM tablename WHERE msg_recip=20 AND msg_status=1 AND msg_time< ORDER BY msg_time DESC
I’m running MySQL - 4.1.20
The statement is:
SELECT msg_id FROM tablename WHERE msg_recip=$usrdata[m_id] AND msg_status=1 AND msg_time<$en[msg_time] ORDER BY msg_time DESC