I need to check and make sure that there are no duplicates of TXN_ID
$sql = "Insert into SALES(ID, AFFID, PRICE, PRODUCT, D, M, Y, H, TXN_ID)
VALUES('','$aff_id','$amount','$item', '$day', '$month', '$year', '$hour', '$pro_id');";
mysql_query($sql) or die(mysql_error());
if there is a duplicate the query needs to do nothing if there is no duplicates the above query needs to be run.
I can't figure the best way to do it without looping through all the entries.
Please provide an example.
Thanks
$sql = "Insert into SALES(ID, AFFID, PRICE, PRODUCT, D, M, Y, H, TXN_ID)
VALUES('','$aff_id','$amount','$item', '$day', '$month', '$year', '$hour', '$pro_id');";
mysql_query($sql) or die(mysql_error());
if there is a duplicate the query needs to do nothing if there is no duplicates the above query needs to be run.
I can't figure the best way to do it without looping through all the entries.
Please provide an example.
Thanks