thefortrees Posted July 23, 2007 Share Posted July 23, 2007 hi all - If I were to pass values from a form and search for values in the database that are similar to my search form values, what purpose does concat() and % serve in this code? $q = //form value; $query = "SELECT i.item FROM vcart_item i, vcart_itemblock ib WHERE i.item = ib.item AND (i.title like concat('%', $q, '%') or i.prodid like concat('%', $q, '%')"; Link to comment https://forums.phpfreaks.com/topic/61417-solved-concat/ Share on other sites More sharing options...
Wildbug Posted July 23, 2007 Share Posted July 23, 2007 http://dev.mysql.com/doc/refman/5.1/en/string-comparison-functions.html#operator_like http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_concat Link to comment https://forums.phpfreaks.com/topic/61417-solved-concat/#findComment-305662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.