R0CKY Posted March 27, 2009 Share Posted March 27, 2009 I have a line of code that selects from the dbase ordered by the date of the entry, like this : $result = $db->GetArray("SELECT * FROM ".$dbPrefix."files ORDER BY file_time DESC"); I would like to exclude from that result though when a specific field (ID) is a specific value (40) So in plain English it would be "select from the dbase ordered by time, excluding all files where the ID = 40. How would I alter the above code to achieve this? Many thanks! Link to comment https://forums.phpfreaks.com/topic/151455-help-with-select-criteria/ Share on other sites More sharing options...
MadnessRed Posted March 27, 2009 Share Posted March 27, 2009 $result = $db->GetArray("SELECT * FROM ".$dbPrefix."files WHERE `id` <> 40 ORDER BY file_time DESC"); Link to comment https://forums.phpfreaks.com/topic/151455-help-with-select-criteria/#findComment-795533 Share on other sites More sharing options...
R0CKY Posted March 27, 2009 Author Share Posted March 27, 2009 Thank you. Link to comment https://forums.phpfreaks.com/topic/151455-help-with-select-criteria/#findComment-795559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.