change if($con) to if(!$con)