jitesh Posted April 10, 2007 Share Posted April 10, 2007 Hi All, I want to implement a keyword search in which i need a criteria that the key words which found exact match should show at top. Can anyone give the idea ? Thanks Link to comment https://forums.phpfreaks.com/topic/46386-keyword-search/ Share on other sites More sharing options...
trq Posted April 10, 2007 Share Posted April 10, 2007 SELECT data FROM foo WHERE data LIKE '%{$keyword}%'; Link to comment https://forums.phpfreaks.com/topic/46386-keyword-search/#findComment-225616 Share on other sites More sharing options...
jitesh Posted April 10, 2007 Author Share Posted April 10, 2007 Thanks Thorpe But,I need the exact match found results as top (Asc). Not just needed the search result. Suppose the search keyword is shoe. and the results are formal shoe,shoe etc. then the result shoe should be at top. Link to comment https://forums.phpfreaks.com/topic/46386-keyword-search/#findComment-225678 Share on other sites More sharing options...
suzzane2020 Posted April 10, 2007 Share Posted April 10, 2007 select * from table where match(fieldname) against(keyword) gives the result in asc order with the exact match at the top Link to comment https://forums.phpfreaks.com/topic/46386-keyword-search/#findComment-225683 Share on other sites More sharing options...
jitesh Posted April 10, 2007 Author Share Posted April 10, 2007 Thanks It gives enought idea Link to comment https://forums.phpfreaks.com/topic/46386-keyword-search/#findComment-225701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.