I have a MySQL database which requires unique customer codes- I am trying to insure that when entering a new customer that you cannot duplicate an existing code. I thought that this would work; however it doesn't seem to do what I expected, that is, it rejects all codes entered... Can someone please help here???
TIA, here's my code:
TIA, here's my code:
Code:
$check = mysql_query("SELECT * FROM clients WHERE code = '$code' ",$linkid);
if ($check !==FALSE)
{
print "<h3>The code $code is in use. Try another code.</h3>";
exit;
}