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, '%')"; Quote Link to comment 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 Quote Link to comment 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.