I have a transaction in mysql which insert data into two tables (it works fine ):
START TRANSACTION;
INSERT INTO tbl_chart (acode,adesc) VALUES (2,'3');
INSERT INTO tbl_pics (ID ,adesc) VALUES (1,'1');
COMMIT ;
But i want that if a error comes then the data should not be inserted in the particular tables . But now when error comes it shows it and also saves the data in table . I do not want this . i want that if error comes then it shows the error and do not save the data in tables . ? how to do it ?