MySQL Forums
Forum List  »  General

mysql query to chop up whole words from a title
Posted by: Gary Corcoran
Date: November 07, 2016 07:36AM

Hi

I'm listing some products, when the user clicks a certain product, after the information about this product, I want to list similar items of that product title .. :ie if the title was "sweet apple cider" I need to go through this title and list anything that relates to those words...

select * from db where title like '%sweet%'

select * from db where title like '%apple%'

select * from db where title like '%cider%'

this is done on the fly so a query that could split this up into an array and search on it like this would be great....

select * from db where title like '%sweet%' or like '%apple%' or like '%cider%'

Options: ReplyQuote


Subject
Written By
Posted
mysql query to chop up whole words from a title
November 07, 2016 07:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.