NameDateSize

..15-Mar-2013

config.m418-Dec-20121.8 KiB

config.w3218-Dec-2012364

CREDITS18-Dec-2012102

Makefile.frag18-Dec-20121.1 KiB

package2.xml18-Dec-20125 KiB

pdo.c03-Jan-201410.1 KiB

pdo.php18-Dec-20121.2 KiB

pdo_dbh.c28-Jan-201448.6 KiB

pdo_sql_parser.c03-Jan-201419.3 KiB

pdo_sql_parser.re08-Nov-201314.1 KiB

pdo_sqlstate.c03-Jan-201413.4 KiB

pdo_stmt.c03-Jan-201478.5 KiB

php_pdo.h03-Jan-20143 KiB

php_pdo_driver.h03-Jan-201423.5 KiB

php_pdo_int.h03-Jan-20143.7 KiB

README18-Dec-20121.9 KiB

tests/09-Nov-2013

TODO18-Dec-20122.3 KiB

README

1$Id$
2
3PHP Data Objects
4================
5
6Concept: Data Access Abstraction
7
8Goals:
9
101/  Be light-weight
112/  Provide common API for common database operations
123/  Be performant
134/  Keep majority of PHP specific stuff in the PDO core (such as persistent
14    resource management); drivers should only have to worry about getting the
15    data and not about PHP internals.
16
17
18Transactions and autocommit
19===========================
20
21When you create a database handle, you *should* specify the autocommit
22behaviour that you require.  PDO will default to autocommit on.
23
24$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true));
25
26When auto-commit is on, the driver will implicitly commit each query as it is
27executed.  This works fine for most simple tasks but can be significantly
28slower when you are making a large number of udpates.
29
30$dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false));
31
32When auto-commit is off, you must then use $dbh->beginTransaction() to
33initiate a transaction.  When your work is done, you then call $dbh->commit()
34or $dbh->rollBack() to persist or abort your changes respectively.  Not all
35databases support transactions.
36
37You can change the auto-commit mode at run-time:
38
39$dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false);
40
41Regardless of the error handling mode set on the database handle, if the
42autocommit mode cannot be changed, an exception will be thrown.
43
44Some drivers will allow you to temporarily disable autocommit if you call
45$dbh->beginTransaction().  When you commit() or rollBack() such a transaction,
46the handle will switch back to autocommit mode again.  If the mode could not
47be changed, an exception will be raised, as noted above.
48
49When the database handle is closed or destroyed (or at request end for
50persistent handles), the driver will implicitly rollBack().  It is your
51responsibility to call commit() when you are done making changes and
52autocommit is turned off.
53
54vim:tw=78:et
55
56
57