svn: /phpdoc/ doc-base/trunk/entities/global.ent en/trunk/reference/mysqli/constants.xml en/trunk/reference/mysqli/mysqli/begin-transaction.xml

From: Date: Thu, 03 Sep 2015 21:43:21 +0000
Subject: svn: /phpdoc/ doc-base/trunk/entities/global.ent en/trunk/reference/mysqli/constants.xml en/trunk/reference/mysqli/mysqli/begin-transaction.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-13704@lists.php.net to get a copy of this message
philip Thu, 03 Sep 2015 21:43:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=337739 Log: Added basic begin_transaction() (and related constants) documentation, as requested by PHP Bug #69813 Bug: https://bugs.php.net/69813 (Verified) mysqli::begin_transaction missing $flags documentation Changed paths: U phpdoc/doc-base/trunk/entities/global.ent U phpdoc/en/trunk/reference/mysqli/constants.xml U phpdoc/en/trunk/reference/mysqli/mysqli/begin-transaction.xml Modified: phpdoc/doc-base/trunk/entities/global.ent =================================================================== --- phpdoc/doc-base/trunk/entities/global.ent 2015-09-03 21:09:03 UTC (rev 337738) +++ phpdoc/doc-base/trunk/entities/global.ent 2015-09-03 21:43:21 UTC (rev 337739) @@ -371,6 +371,7 @@ <!ENTITY url.muscat.xapian "http://xapian.org/"> <!ENTITY url.mysql "http://www.mysql.com/"> <!ENTITY url.mysql.docs "http://dev.mysql.com/doc/"> +<!ENTITY url.mysql.docs.commit "http://dev.mysql.com/doc/mysql/en/commit.html"> <!ENTITY url.mysql.docs.date "http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html"> <!ENTITY url.mysql.docs.error "http://dev.mysql.com/doc/mysql/en/error-handling.html"> <!ENTITY url.mysql.docs.error.msg "http://dev.mysql.com/doc/mysql/en/error-handling.html"> Modified: phpdoc/en/trunk/reference/mysqli/constants.xml =================================================================== --- phpdoc/en/trunk/reference/mysqli/constants.xml 2015-09-03 21:09:03 UTC (rev 337738) +++ phpdoc/en/trunk/reference/mysqli/constants.xml 2015-09-03 21:43:21 UTC (rev 337739) @@ -734,6 +734,33 @@ </para> </listitem> </varlistentry> + <varlistentry xml:id="constantmysqli-trans-start-read-only"> + <term><constant>MYSQLI_TRANS_START_READ_ONLY</constant></term> + <listitem> + <para> + Start the transaction as "START TRANSACTION READ ONLY" with + <function>mysqli_begin_transaction</function>. + </para> + </listitem> + </varlistentry> + <varlistentry xml:id="constantmysqli-trans-start-read-write"> + <term><constant>MYSQLI_TRANS_START_READ_WRITE</constant></term> + <listitem> + <para> + Start the transaction as "START TRANSACTION READ WRITE" with + <function>mysqli_begin_transaction</function>. + </para> + </listitem> + </varlistentry> + <varlistentry xml:id="constantmysqli-trans-start-consistent-snapshot"> + <term><constant>MYSQLI_TRANS_START_CONSISTENT_SNAPSHOT</constant></term> + <listitem> + <para> + Start the transaction as "START TRANSACTION WITH CONSISTENT SNAPSHOT" with + <function>mysqli_begin_transaction</function>. + </para> + </listitem> + </varlistentry> </variablelist> </appendix> Modified: phpdoc/en/trunk/reference/mysqli/mysqli/begin-transaction.xml =================================================================== --- phpdoc/en/trunk/reference/mysqli/mysqli/begin-transaction.xml 2015-09-03 21:09:03 UTC (rev 337738) +++ phpdoc/en/trunk/reference/mysqli/mysqli/begin-transaction.xml 2015-09-03 21:43:21 UTC (rev 337739) @@ -24,11 +24,10 @@ <methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam> </methodsynopsis> <para> - + Begins a transaction. Requires MySQL 5.6 and above, and the InnoDB + engine (it is enabled by default). For additional details about how MySQL transactions + work, see <link xlink:href="&url.mysql.docs.commit;">&url.mysql.docs.commit;</link>. </para> - - &warn.undocumented.func; - </refsect1> <refsect1 role="parameters"> @@ -40,15 +39,35 @@ <term><parameter>flags</parameter></term> <listitem> <para> - + Valid flags are: </para> + <itemizedlist> + <listitem> + <para> + <constant>MYSQLI_TRANS_START_READ_ONLY</constant>: + Start the transaction as "START TRANSACTION READ ONLY". + </para> + </listitem> + <listitem> + <para> + <constant>MYSQLI_TRANS_START_READ_WRITE</constant>: + Start the transaction as "START TRANSACTION READ WRITE". + </para> + </listitem> + <listitem> + <para> + <constant>MYSQLI_TRANS_START_WITH_CONSISTENT_SNAPSHOT</constant>: + Start the transaction as "START TRANSACTION WITH CONSISTENT SNAPSHOT". + </para> + </listitem> + </itemizedlist> </listitem> </varlistentry> <varlistentry> <term><parameter>name</parameter></term> <listitem> <para> - + Savepoint name for the transaction. </para> </listitem> </varlistentry> @@ -63,6 +82,53 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <example> + <title><methodname>$mysqli->begin_transaction</methodname> example</title> + <para>&style.oop;</para> + <programlisting role="php"> +<![CDATA[ +<?php +$mysqli = new mysqli("127.0.0.1", "my_user", "my_password", "sakila"); + +if ($mysqli->connect_errno) { + printf("Connect failed: %s\n", $mysqli->connect_error); + exit(); +} + +$mysqli->begin_transaction(MYSQLI_TRANS_START_READ_ONLY); + +$mysqli->query("SELECT first_name, last_name FROM actor"); +$mysqli->commit(); + +$mysqli->close(); +?> +]]> + </programlisting> + <para>&style.procedural;</para> + <programlisting role="php"> +<![CDATA[ +<?php +$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "sakila"); + +if (mysqli_connect_errno()) { + printf("Connect failed: %s\n", mysqli_connect_error()); + exit(); +} + +mysqli_begin_transaction($link, MYSQLI_TRANS_START_READ_ONLY); + +mysqli_query($link, "SELECT first_name, last_name FROM actor LIMIT 1"); +mysqli_commit($link); + +mysqli_close($link); +?> +]]> + </programlisting> + </example> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para>

« previous php.doc.cvs (#13704) next »