I am trying to streamline my PHP code by making only one search field instead of having several. This one field will allow you to type in a person's ID, part of their name, email, etc. Here is my query:
select date_format(registerDate, '%m-%d-%Y') as registerDate, uID, firstname, lastname, concat( firstname, ' ', lastname ) as fullname,
city, state, visited, date_format(last, '%m-%d-%Y') as last, member, subscription, totalSearches from users
where uID = 'smith' or
membernumber = 'smith' or
email like '%smith%' or
phone like '%smith%' or
city like '%smith%' or
concat( firstname, ' ', lastname ) like '%smith%'
order by uID;
The problem is this query is returning lots of results. It should only be showing users with the last name of smith. Can someone point me in the right direction?