I have two tables:
Clients: id, name Texts: id, text
Field text in Texts table can contain names of clients. I would like to find for each text, clients whose names are contained in text field. For example:
CLIENTS
id | name
1 | John Smith
2 | Mark Jackson
3 | Ann Boo
TEXTS
id | text
1 | John Smith and Ann Boo are my best friends.
2 | I really don't like Mark Jackson and John Smith.
The result should be:
RESULT
Text.id | Client.id | Client.name
1 | 1 | John Smith
1 | 3 | Ann Boo
2 | 1 | John Smith
2 | 2 | Mark Jackson
I hope you will help me :) I want to know what parameters should find() function have or just mysql query