I am trying to make a form that certain fields will be checked against the data in mysql, this is to avoid duplicates. Below is the code I am trying to use. It is to verify that a phone number is not already in database. i first checked that it was there, and then i tried to check it against the database, however it is simply going to my not uploaded warning. What can I do? Is there maybe a better way to do this? as this is one of many checks like this. Note: this is not a primary nor will be. if(empty($_POST['home_phone'])){$errors[]='Home Phone Required'; }else{ $hp=trim($_POST['home_phone']); } if($hp){ //connects to databse require_once('./db_config.php'); $hpq="SELECT home_phone FROM leads where home_phone='$hp'"; $hpresult= mysql_query($hpq) or trigger_error("Query: $hpq\n<br/>MYSQL Error:".mysql_errno()); if (mysql_num_rows($hpresult)==0){$home_phone=trim($_POST['home_phone']);}Else{ $errors[]='Duplicate Lead';} ;} //If no errors if(empty($errors))