friedice Posted April 8, 2011 Share Posted April 8, 2011 hi im having trouble with this query i wana select 3 events that only contain seminar and are the next dates from NOW() date Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() DESC LIMIT 3 thx Link to comment https://forums.phpfreaks.com/topic/233066-sql-query-help/ Share on other sites More sharing options...
gristoi Posted April 8, 2011 Share Posted April 8, 2011 Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() ORDER BY Date DESC LIMIT 3 Link to comment https://forums.phpfreaks.com/topic/233066-sql-query-help/#findComment-1198635 Share on other sites More sharing options...
friedice Posted April 8, 2011 Author Share Posted April 8, 2011 cool thx hmm cant even make it ascending order $squery = "Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() ORDER BY Date ASC DESC LIMIT 3 "; Link to comment https://forums.phpfreaks.com/topic/233066-sql-query-help/#findComment-1198640 Share on other sites More sharing options...
gristoi Posted April 8, 2011 Share Posted April 8, 2011 you can only have it in Descending or Ascending - not both cool thanks hmm cant even make it ascending order $squery = "Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() ORDER BY Date ASC DESC LIMIT 3 "; Link to comment https://forums.phpfreaks.com/topic/233066-sql-query-help/#findComment-1198642 Share on other sites More sharing options...
friedice Posted April 8, 2011 Author Share Posted April 8, 2011 omg i just realised i used desc before already thx solved Link to comment https://forums.phpfreaks.com/topic/233066-sql-query-help/#findComment-1198643 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.