Php simple search

Hello,

I’m looking for a simple search function in php to check if a user name is already created.
I created a table “member” with 2 rows : “id” and “name”.

I want to create a simple form that checks if a name is already taken or is free.

The form i have now is :

<form method="get" action="search.php">
<input name="searchinput" type="text" value="check" onclick="this.value=''" />
<input type="image" src="gfx/button.jpg">
</form>

The php search i have now is

<?php
mysql_connect("localhost","*****","******");
mysql_select_db("database");
$search = $_GET["searchinput"];
$search = mysql_real_escape_string($search);
$result = mysql_query("SELECT * FROM member WHERE (name LIKE '%" . $search . "%')");    
if($search == ""){
print "ENTER SOMETHING";
}else{
if(mysql_num_rows($result) > 0) {
while($r=mysql_fetch_array($result)) {
$name = $r["name"];
print "$name already taken";
}      
} else {
print "$name already taken";
}
}
?>

The only problem with the script above is that when someone searches for “ste” or “steven” he doesn’t make a difference and because it is to check if a user name is already taken this isn’t a good solution.