query for identical field and echo...
Hello all,
I have a questionaire that consists of four pages. Hidden fields are used to carry the information from page to page. The code below is from the first page. I am trying to query the database to see if the propertyname already exists; if it does, to echo an error while keeping the other user-entered information intact. Here's what I've come up with so far, but in preview nothing happens when I enter an already used propertyname. Any help would be most appreciated!
<?php require_once('Connections/connectdb.php'); ?>
<?php
$connectdb;
@mysql_select_db(rentlogin) or die( "Unable to select database");
$Propertyname = $_POST['Propertyname'];
$check = mysql_query("select Propertyname from owner_prop where Propertyname=\"$Propertyname\"");
$returned = mysql_fetch_array($check);
if (isset($_POST['Propertyname']))
if(!empty($returned))
{ echo 'Propertyname already exists, please choose another name.';
mysql_close($connectdb);
Die();
}
?>
|