I need to search first name or last name from the beginning of characters. For example, firstname is Michael and lastname is Jordan. If I search "dan" or "hae" words, it shouldn't return result. Only if I search "mic" or "jor", it should return firstname and lastname together. Is there any way to do it with mysql ?
My following code does not return what I expect.
select * from users where (firstname like '%$searchWord%' or lastname like '%$searchWord%')