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 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%' 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 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 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
Archived
This topic is now archived and is closed to further replies.