scvinodkumar Posted April 7, 2009 Share Posted April 7, 2009 hi i want a query which needs to fetch the records based on the keywords given. for example, i have two text fields keywords_in and keyword_out. keywords_in means which fetch the records those records matches with this keyword keywords_out means which should not display those records matches with this keyword so based on this i need to fetch the record in single query how to do this? Link to comment https://forums.phpfreaks.com/topic/152936-query-for-like-and-not-like/ Share on other sites More sharing options...
scvinodkumar Posted May 4, 2009 Author Share Posted May 4, 2009 is there somebody to help me on this issues. I just need a query for this to retrieve the records based on the keywords_in and keywords_out The two fields name is "title" and "content" so if i enter "green,envirnoment" in keywords_in then it should bring those records containing these keywords using the above two fields. if i enter "terrorism,violence" in keywords_out then it should not bring those records containing these keywords using the above two fields. I hope you peoples understand my english.. Thanks for your help:) Link to comment https://forums.phpfreaks.com/topic/152936-query-for-like-and-not-like/#findComment-825442 Share on other sites More sharing options...
mikesta707 Posted May 4, 2009 Share Posted May 4, 2009 the mysql command "like" is probably around what you looking for http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html there is also a "not like" command that is on that same page you will probably want to check out as well Link to comment https://forums.phpfreaks.com/topic/152936-query-for-like-and-not-like/#findComment-825446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.