I've got a search feature to search for all User Names simialr to what is entered as the search criteria.
I have two users (Joe, John) and when I enter 'Jo' as the search criteria I would expect both Joe and John to be found but I don't get any results. I think my SQL statement is correct but even if I put in John or Joe I still get no results?? Could someone have a look for me.
Thanks.
EDIT: I substituted * for % and everything works finePHP Code://This is my query
$query = "SELECT * FROM user_details WHERE user_name LIKE '$username*'";
$result = mysql_query($query);
//Check for matches
if (mysql_num_rows($result) == 0) {
echo "There were no users found with the user name entered";
exit;
}
![]()


Reply With Quote