Canman2005 Posted July 23, 2008 Share Posted July 23, 2008 Hi all I have the following QUERY SELECT * FROM news WHERE title LIKE '%".$_GET['q']."%' OR content LIKE '%".$_GET['q']."%' AND pageid != 3496 How can I mod this QUERY so that if pageid does = 3496 then it just returns the last 10 rows for any rows containing 3496 but still keep it returning * Does that make sense? Any help would be ace Thanks Ed Link to comment https://forums.phpfreaks.com/topic/116172-solved-if-statement-in-query/ Share on other sites More sharing options...
paul2463 Posted July 23, 2008 Share Posted July 23, 2008 SELECT * FROM news WHERE title LIKE '%".$_GET['q']."%' OR content LIKE '%".$_GET['q']."%' AND pageid = 3496 ORDER BY pageid DESC LIMIT 10 Link to comment https://forums.phpfreaks.com/topic/116172-solved-if-statement-in-query/#findComment-597398 Share on other sites More sharing options...
Canman2005 Posted July 23, 2008 Author Share Posted July 23, 2008 Thanks Link to comment https://forums.phpfreaks.com/topic/116172-solved-if-statement-in-query/#findComment-597434 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.