Cancelling query
Posted: Tue May 24, 2005 10:36 pm
Is there a way to cancel a query operation in mysql. I mean, I want to INSERT a record into database but cancel it if it already exists.
ON DUPLICATE KEY UPDATE and IGNORE are not for this situation for it only check if duplicates for unique fields.
Please help.
Code: Select all
$query = "e;INSERT INTO table (field1,field2) VALUES ('val1','val2')"e;; //if no record with the same field values exists.Please help.