Hello,
Right now I have a table set up with a first_name and last_name field in it. I have a search box the user can enter text into and I am trying to make it so that if they enter "John Smith" the database will check both first_name and last_name for "John" and "Smith".
Something that might look like this:
SELECT * FROM names WHERE (first_name OR last_name) LIKE "John" OR (first_name OR last_name) Like "Smith";
Is there any way to do this without going the long way and putting first_name LIKE "John" OR first_name LIKE "Smith" OR ... ?
It has to check both because the user might enter "Smith John" or "John Smith" and I want both to return the same result.
Also just using first_name and last_name form fields is not a viable option for this.
Thanks in advance for any help you can give me