So far all the MySQL queries I've used that include WHERE have been nice and simple, such as:
But what happens if the field you're dealing with is populated by a series of keywords and you want to make a selection based on just one from that series?
I've started looking at the use of IN, eg:
Is that the right approach? So far no results have been produced, though I'm not getting any error messages.
Also, how should the keywords be set up in the MySQL table, in terms of if they need to be separated by a comma and any specific settings for the field?
many thanks
Edit:
Also tried using LIKE within the SELECT statement but this only appeared to return results where the keyword was the only word in the field rather than being one of several.
Have also started to look at using MATCH() and AGAINST(), like this:
but get "Can't find FULLTEXT index matching the column list"
??
Code:
SELECT * FROM subs WHERE exhibitions='yes'
But what happens if the field you're dealing with is populated by a series of keywords and you want to make a selection based on just one from that series?
I've started looking at the use of IN, eg:
Code:
SELECT * FROM subs WHERE keywords IN ('invite')
Is that the right approach? So far no results have been produced, though I'm not getting any error messages.
Also, how should the keywords be set up in the MySQL table, in terms of if they need to be separated by a comma and any specific settings for the field?
many thanks
Edit:
Also tried using LIKE within the SELECT statement but this only appeared to return results where the keyword was the only word in the field rather than being one of several.
Have also started to look at using MATCH() and AGAINST(), like this:
Code:
SELECT * FROM subs WHERE MATCH (notes) AGAINST ('invite')
but get "Can't find FULLTEXT index matching the column list"
??
Last edited: