php - Mysqli rollback not working -
the mysqli documentation indicates if call autocommit(false)
returns true, successful in disabling automatic committing of queries.
still, if try rollback transaction, created following code, information remains deleted.
$dbconn= new mysqli($host, $user, $pass, $db) or die('could not connect'); $dbconn->autcocommit(false); //returns true $dbconn->query($deletequery); $dbconn->query($deletequery2); $dbconn->rollback();
what go wrong in situation?
rollback works innodb tables not myisam. make sure tables using in $deletequery (query) innodb.
Comments
Post a Comment