dachshund Posted July 29, 2009 Share Posted July 29, 2009 How can I put LIKE '%interview%' and '%feature%' as well? $sql="SELECT * FROM content WHERE `section` LIKE '%interview%' ORDER BY date DESC LIMIT 1"; Quote Link to comment Share on other sites More sharing options...
abazoskib Posted July 29, 2009 Share Posted July 29, 2009 "like" this: $sql="SELECT * FROM content WHERE `section` LIKE '%interview%' AND xxx LIKE '%feature%' ORDER BY date DESC LIMIT 1"; just re read your post, if you want section to be like '%interview%' or '%feature%' then use OR $sql="SELECT * FROM content WHERE `section` LIKE '%interview%' OR `section` LIKE '%feature%' ORDER BY date DESC LIMIT 1"; Quote Link to comment Share on other sites More sharing options...
dachshund Posted July 29, 2009 Author Share Posted July 29, 2009 yeah was OR, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.