maxdb_rollback
maxdb::rollback
Rolls back current transaction
&reftitle.description;
&style.procedural;
boolmaxdb_rollback
resourcelink
&style.oop;
boolmaxdb::rollback
Rollbacks the current transaction for the database specified by the
link parameter.
&reftitle.returnvalues;
&return.success;
&reftitle.examples;
&style.oop;
autocommit(FALSE);
$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city");
$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city");
/* commit insert */
$maxdb->commit();
/* delete all rows */
$maxdb->query("DELETE FROM temp.mycity");
if ($result = $maxdb->query("SELECT COUNT(*) FROM temp.mycity")) {
$row = $result->fetch_row();
printf("%d rows in table mycity.\n", $row[0]);
/* Free result */
$result->close();
}
/* Rollback */
$maxdb->rollback();
if ($result = $maxdb->query("SELECT COUNT(*) FROM temp.mycity")) {
$row = $result->fetch_row();
printf("%d rows in table mycity (after rollback).\n", $row[0]);
/* Free result */
$result->close();
}
/* Drop table myCity */
$maxdb->query("DROP TABLE temp.mycity");
$maxdb->close();
?>
]]>
&style.procedural;
]]>
&example.outputs.similar;
&reftitle.seealso;
maxdb_commit
maxdb_autocommit