The code below is my search code, if i search for the username john it will display it but if i search JOHN, joh, jo, or j it will echo no match was found how can i fix that.
Code:
If(empty($_POST['search_q'])){
echo "Enter search word";
}else{
$term = $_POST["search_q"];
$result = @mysql_query("SELECT * FROM user WHERE name like '%$term%' ",$dbconnect);
$myrow = @mysql_fetch_array($result);
$uname = $myrow[username];
echo "$uname";
}else{
echo "No match was found";
}
}
Comment