Page 1 of 1

More than one term in category field???

Posted: Tue Mar 31, 2009 3:49 pm
by imimin
I am setting up a SQL query that will be used to filter search results with a WHERE clause. In my MySQL DB, I have set up a "cat" column. Is there a way to enter more than one term in the cat field so I can give each row more than one category (such as 'child,solid')? I tried using an "," and ";" delimiter, but neither worked. It seems to only work if I have only one category in the cat field.

Thanks in advance for any help!

Gary

Re: More than one term in category field???

Posted: Wed Apr 01, 2009 2:08 am
by jaoudestudios
If you are using a MyIsam database engine, then you could do a Full text search.

Or explode the search field on white space and make your WHERE clause with ANDs or ORs.
ie. search term = walked downstairs
...WHERE column1 LIKE '%walked%' AND column1 LIKE '%downstairs%'