php search function

Posted by Luke on Stack Overflow See other posts from Stack Overflow or by Luke
Published on 2010-05-14T15:20:52Z Indexed on 2010/05/14 15:24 UTC
Read the original article Hit count: 291

Filed under:

I am attempting to create a search function for user profiles on my site.

$search= $_POST['search'];
$res=mysql_query("SELECT * FROM ".TBL_USERS." WHERE username LIKE '$search%'");

This is the code I use. This will only work if you search something that matches the start of the result. Is there any way I can return values that have what i type as part of the username regardingless of upper or lower cases?

Thankyou

© Stack Overflow or respective owner

Related posts about php