cimerol Posted October 15, 2008 Share Posted October 15, 2008 Hi All, I have a DB which contains products, and each product has a keyword which can be queried. I want the keywords in the DB field to be comma separated. This way when a user enters a keyword in a search box and clicks submits, you get the results. i.e. Product 1 Name = Big Bear Keywords = bear, big bear, polar bear Product 2 Name = Small Bear Keywords = bear, small bear A user enters the word BEAR into a search box, clicks submit. The results should show both Product 1 & Product 2. Much like how an ecommerce site functions. Any ideas? Thanks, Norm Link to comment https://forums.phpfreaks.com/topic/128467-query-db-field-containing-csv/ Share on other sites More sharing options...
xtopolis Posted October 15, 2008 Share Posted October 15, 2008 Don't use CSV in fields. Don't. Possibly make product name be a fulltext, have mysql look for the user so you don't have to make keywords. http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html Otherwise, I would suggest 3 tables: product, keywords, productID_keywordID Link to comment https://forums.phpfreaks.com/topic/128467-query-db-field-containing-csv/#findComment-665764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.