hi every one
i'have a problem again
i have entered a number in some feild in my website
and i want to save it to my database but before i want to check if there is a dublicate or not so if the number found it dosn't save it & tell me there
there is a dublicate & dosent save the number & ask me again to enter a new number ??
$sql="select field from table";
$result=mysql_query($sql);
$row=mysql_fetch_assoc($result);
if ($row['field'] == $_POST['my_var'])
{
echo $_POST['my_var'].' is already in the database. Please try again..';
exit;
}
// otherwise, do other stuff...
[Edited: Matching the fieldnames to lessen confusion. --JAM]