0

Hello everyone. This is my first post to this site. I've used it before as a reference and now I'm here with a question of my own.

I'm currently storing some data in a row like this:
"apples, oranges, pears, bananas, peaches"

Basically the row contains just a few terms separated by commas.

I need some help to formulate a SQL search statement on this row. Say the search term is "pears,peaches". Using the row above as a reference I want it to return results for any match of the search term in the row.

Search terms:
"pears,peaches" would return results
"bananas,oranges,apples" would return results
"apples" would return results

etc.

I've tried using the LIKE command. However it seems that some of my results are being left out because of the way I have the search terms formulated and the data setup.

Any ideas?

Thanks,
Tegan

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by tegansnyder
0

I just marked my row as "FULL TEXT" in phpMyAdmin.

Now I'm able to use the niffy search terms.
"SELECT txt FROM {my_table} WHERE MATCH txt AGAINST ('$txt' IN BOOLEAN MODE)"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.