Jump to content

Searching several words in one field.


mhodgson

Recommended Posts

If I have series of database entries in one field taht contains a list of words, e.g.

 

ID - animal types

1  - cat, dog, elephant, rhino

2  - cat, rhino, frog

3  - dog, frog, tiger

 

I want to be able to search this field by one word, e.g. cat, and only show the records that contain 'cat' in the field.

 

I know how to split the list at each comma and I'm sure it should all go in an array but beyond that I'm a little stumped.

 

Any suggestions would be great.

Thanks

Link to comment
https://forums.phpfreaks.com/topic/96917-searching-several-words-in-one-field/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.