Selecting MySql rows where a certain word exists and doesn't exist?

Can I select rows from a MySql db where a certain word is missing? For instance to select a row that has a keyword, I can use:

“SELECT * from table where keyword like ham”; I am familiar with this technique.

But how can I select all from the table where there is no word such as ham in the keywords? Is there such a method?

You can
It should work like this
SELECT * FROM table WHERE column<>“ham”;

Or you can use the != operator

tbh, this is a php section and not database related, but hell, I solved it for you

Thanks, I’ll give it a try. I just figured MySql questions were asked here because PHP and MySql. Will keep that in mind.

Just realised that the mysql statement is for things that don’t exist, you can only do one at a time so you will have to make another statement for those for finding things that do exists, just get rid of the ! in the != operator

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.