I am trying to understand what is the best way to construct a query string with php when there are multiple columns I want it to look for.
For example the database has id, name, email, date.
And I have a search input field on a page which when submitted, I want it to search based on the input field against the above mentioned columns. Best what is the best way/practice to do that?
I have the following so far but it seems like it is a "dumb" search.
"SELECT * FROM Table WHERE id LIKE '$search%' || name LIKE '$search%' || email LIKE '$search%' || date LIKE '$search%'";
Well this sort of works but I feel there has to be a better way and a more appropriate smarter method.
Thanks...