Hi there,

I've been trying for hours to figure out how I can do something along these lines.

I have a text box, where someone can type a search keyword. It is searching a database of usernames.

What I want to be able to do is put say "jona" in the text box and have it search mysql WHERE Nickname=jona and return a list of ALL matching nicknames that contain "jona" in any part of it.

another example might be if i searched "alex"

it would return Alex, Alexander, Alexandra, Alejandro, etc (assuming all those usernames existed)

Thanks in advance for anyone who is able to help.

    $query = "SELECT * FROM `table` WHERE `column` LIKE '%$valueFromForm%'";
    

    (Where $valueFromForm is an appropriately escaped string)

      Write a Reply...