Having trouble with proper usage of mysqli autocommit. Below are the queries.
Table1 and Table3 are InnoDB while Table2 is MyISAM
Values to Table2 and Table3 are inserted properly but values to Table1 are not being stored. No errors occur while running the code.
$dbconnect->autocommit(false);
$stmt = $dbconnect->prepare("INSERT INTO `table1`(`col1`,`col2`) VALUES (?,?)");
$stmt->bind_param('ss',$val1,$val2);
$stmt->execute();
$dbconnect->rollback();
$stmt = $dbconnect->prepare("INSERT INTO `table2`(`col1`,`col2`) VALUES (?,?)");
$stmt->bind_param('ss',$val3,$val4);
$stmt->execute();
$dbconnect->rollback();
$stmt = $dbconnect->prepare("INSERT INTO `table3`(`col1`,`col2`) VALUES (?,?)");
$stmt->bind_param('ss',$val5,$val6);
$stmt->execute();
$dbconnect->commit();
When and how do you use autocommit(false) and rollback()?