Reputation: 5872
I have a MySQL db and I am using mysqli
.
for some reason I can't get transactions to work properly. If I call $mysqli->rollback()
, it does not roll back.
example code:
$mysqli->autocommit(false);
$sql = "INSERT INTO myTable (name , color) VALUES ('Dan' , 'red')";
$mysqli->query($sql);
$mysqli->rollback();
Tthe result is that another row is added to myTable. Can anyone think of a reason why?
Upvotes: 3
Views: 3379
Reputation: 620
are you using myIsam or innodb?? becouse it only works for innodb as far as i know
Upvotes: 9