I have a mysql column(name) with some text like this "firstname middlename surname lastname".
How can i select that row with a query like
SELECT name FROM client WHERE name like %firstname lastname%
. The where clause comes from a single html input text.
3
Answers
Could you use
You can search by separating the words in two where argumants
If you want it the way you asked, you could do it like this
So if in your table at the field "name" you have a value that is "John Fidzerald Mayhem Doe", it will be selected
But if I can advice you, create a column for each value you want, so a column for firstName which would not be nullable, a column for middlename which would be nullable, a column for surname which would be also nullable and a column for lastname which wouldn’t be nullable