diff --git a/reference/mysqli/quickstart.xml b/reference/mysqli/quickstart.xml index acd9cf603b..729c07dfc5 100644 --- a/reference/mysqli/quickstart.xml +++ b/reference/mysqli/quickstart.xml @@ -1612,27 +1612,22 @@ to use near 'DROP TABLE mysql.user' at line 1 Transactions can either be controlled using SQL or API calls. It is recommended to use API calls for enabling and disabling the - auto commit mode and for committing and rolling back transactions. + autocommit mode and for committing and rolling back transactions. - Setting auto commit mode with SQL and through the API + Setting <literal>autocommit</literal> mode with SQL and through the API connect_errno) { - echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; -} /* Recommended: using API to control transactional settings */ $mysqli->autocommit(false); /* Won't be monitored and recognized by the replication and the load balancing plugin */ -if (!$mysqli->query('SET AUTOCOMMIT = 0')) { - echo "Query failed: (" . $mysqli->errno . ") " . $mysqli->error; -} -?> +$mysqli->query('SET AUTOCOMMIT = 0'); ]]> @@ -1642,7 +1637,7 @@ if (!$mysqli->query('SET AUTOCOMMIT = 0')) { can easily monitor API calls. The replication plugin offers transaction aware load balancing, if transactions are controlled with API calls. Transaction aware load balancing is not available if SQL statements are - used for setting auto commit mode, committing or rolling back a transaction. + used for setting autocommit mode, committing or rolling back a transaction. @@ -1650,6 +1645,7 @@ if (!$mysqli->query('SET AUTOCOMMIT = 0')) { autocommit(false); @@ -1658,7 +1654,6 @@ $mysqli->rollback(); $mysqli->query("INSERT INTO test(id) VALUES (2)"); $mysqli->commit(); -?> ]]> @@ -1673,8 +1668,9 @@ $mysqli->commit(); mysqli::autocommit - mysqli_result::commit - mysqli_result::rollback + mysqli::begin_transaction + mysqli::commit + mysqli::rollback