rahuul Posted May 1, 2009 Share Posted May 1, 2009 hi friends, I hv a problem, can any one help I want to search a keyword such as `mica` from product field. I want that it should display all products that contain `mica` word. such as chemical. pls help me. thanks in advance Rahul Quote Link to comment https://forums.phpfreaks.com/topic/156417-solved-query-for-selecting-keyword-for-database/ Share on other sites More sharing options...
Maq Posted May 1, 2009 Share Posted May 1, 2009 You would need to incorporate something such as: WHERE product LIKE '%mica%' Quote Link to comment https://forums.phpfreaks.com/topic/156417-solved-query-for-selecting-keyword-for-database/#findComment-823547 Share on other sites More sharing options...
Ken2k7 Posted May 1, 2009 Share Posted May 1, 2009 $query = "SELECT * FROM `table_name` WHERE `product` LIKE '%" . $keyword . "%'"; Where $keyword is mika Quote Link to comment https://forums.phpfreaks.com/topic/156417-solved-query-for-selecting-keyword-for-database/#findComment-823548 Share on other sites More sharing options...
rahuul Posted May 1, 2009 Author Share Posted May 1, 2009 thanks Quote Link to comment https://forums.phpfreaks.com/topic/156417-solved-query-for-selecting-keyword-for-database/#findComment-823562 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.