kr3m3r Posted August 21, 2007 Share Posted August 21, 2007 Hi guys, I'm trying to search my database for any rows in which one of the columns has part of the search term. It goes something like this: Search term foo. Select * from Library_Asset where UPC like %"foo" or Title like %"foo" or MajorAttribute like %"foo" or SecondaryAttribute like %"foo"; The php code I wrote is: $query = "select * from Library_Asset where UPC like '%".$searchterm."%'" or Title like '%".$searchterm."%'" or MajorAttribute like '%".$searchterm."%'" or SecondaryAttribute like '%".$searchterm."%'"; Which I'm pretty sure is awful. So any help you guys can give me would be incredibly appreciated. Thanks for your time -Robb Quote Link to comment Share on other sites More sharing options...
fenway Posted August 21, 2007 Share Posted August 21, 2007 You can look into full-text indexing. 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.