Hey all, I have a very simple script that checks the posted propertyCode to see if it's already in the db. If so, stop processing, else finish the insert but not matter what I try, it will not catch the duplicates even though there are like 4 in the db that are duplicate. It just keeps inserting new ones. Any idea?
$propertyCode = mysql_real_escape_string(trim($_POST['propertyCode']));
$ckQuery = "SELECT `id` FROM `properties` WHERE `propertyCode` = '$propertyCode'";
$ckResult = mysql_query($ckQuery);
if(!$ckResult){
echo $ckQuery."<br />";
echo "You have entered a Property Code that has already been assigned, click <a href='javascript:history.go(-1);'>here</a> to go back and fix this problem.";
}else{
//insert db code here
}