There's a form where user enters his name to retrieve other info (phone) entered by him earlier. Here's the html-code:

HTML Code:
<form action="retrieve.php" name="secondForm" id="secondForm" method=post>
<input name="name" class="required" type=text ><br>
<input type="submit" >
the php-code is as follows:
PHP Code:
//connect to database
mysql_select_db($database) or die("<b>Unable to specified database</b>");
//perform query
$query "select * from contact where name='$name'";
$result=mysql_query($query) or die('Error, insert query failed');
//get result
"Your phone number is <b> $phone</b> ";

the problem is, that when a user enters a non-existing name and submits it, he gets mysql warning and error. How do I make it that he get a message that no such entry exits without showing him an underfind error from mysql? I know it's something simple but I cannot solve it myself.