search from the first letter of first name or last name in PHP and MYSQL -
i need search first name or last name beginning of characters. example, firstname michael , lastname jordan. if search "dan" or "hae" words, shouldn't return result. if search "mic" or "jor", should return firstname , lastname together. there way mysql ?
my following code not return expect.
select * users (firstname '%$searchword%' or lastname '%$searchword%')
if want search beginning of word have place wildcards @ end of condition:
select * `users` (`firstname` '$searchword%' or `lastname` '$searchword%')
Comments
Post a Comment