I am wondering if i can put something in my query which searches for a word within a string. For example, if i have a field named user_purchased, i want to query it and pull only records where the word 'dog' exists within the string.
I know i can do this using php like this
(!stristr($row['user_purchased'], 'dog'))
BUT, i'm wondering if i can do this in the query itself instead and that this will perhaps speed up performance.
Thanks in advance for help on this
LIKE '%foo%'orINSTRforce a full scan. This will be slow if your table is big. They can not do an index lookup.