2004-11-10 05:26:38 +00:00
|
|
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
2004-11-19 15:55:49 +00:00
|
|
|
<!-- $Revision: 1.9 $ -->
|
2004-11-10 22:21:24 +00:00
|
|
|
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
|
|
|
<reference id="ref.pdo">
|
2004-11-13 22:28:28 +00:00
|
|
|
<title>PDO Functions</title>
|
2004-11-10 22:21:24 +00:00
|
|
|
<titleabbrev>pdo</titleabbrev>
|
|
|
|
|
|
|
|
<partintro>
|
|
|
|
<section id="pdo.intro">
|
2004-11-10 05:26:38 +00:00
|
|
|
&reftitle.intro;
|
|
|
|
<para>
|
2004-11-10 22:21:24 +00:00
|
|
|
&warn.experimental;
|
|
|
|
The PDO extension defines a lightweight, consistent interface
|
|
|
|
for accessing databases in PHP. Each database driver that
|
|
|
|
implements the PDO interface can expose database-specific
|
2004-11-13 22:28:28 +00:00
|
|
|
features as regular extension functions. Note that you cannot
|
|
|
|
perform any database functions using the PDO extension by
|
|
|
|
itself; you must use a <link linkend="pdo.drivers">database-specific
|
|
|
|
PDO driver</link> to access a database server.
|
2004-11-10 22:21:24 +00:00
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
<section id="pdo.installation">
|
|
|
|
&reftitle.install;
|
|
|
|
<para>
|
|
|
|
PDO is currently available as a PECL extension from
|
|
|
|
<ulink url='&url.pecl.package;pdo'>&url.pecl.package;pdo</ulink>.
|
|
|
|
Ensure you have installed the CGI version of PHP and that the
|
|
|
|
<command>pear</command> and <command>phpize</command> scripts are
|
|
|
|
available in your current path.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
Run the following command to download, build, and install the
|
|
|
|
latest stable version of PDO:
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
pear install pdo
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</para>
|
|
|
|
<para>
|
2004-11-19 15:55:49 +00:00
|
|
|
Windows users can download the extension DLL <filename>php_pdo.dll</filename>
|
|
|
|
as part of the PECL collection binaries from
|
|
|
|
<ulink url='&url.php.downloads;'>&url.php.downloads;</ulink>.
|
2004-11-10 22:21:24 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The <command>pear</command> command automatically installs the
|
|
|
|
PDO module into your PHP extensions directory. To enable the
|
2004-11-19 15:55:49 +00:00
|
|
|
PDO extension on Linux or UNIX operating systems, you must add
|
2004-11-10 22:21:24 +00:00
|
|
|
the following line to &php.ini;:
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
extension=pdo.so
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
To enable the PDO extension on Windows operating systems, you must
|
|
|
|
add the following line to &php.ini;:
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
2004-11-19 15:55:49 +00:00
|
|
|
extension=php_pdo.dll
|
2004-11-10 22:21:24 +00:00
|
|
|
]]>
|
|
|
|
</screen>
|
2004-11-10 05:26:38 +00:00
|
|
|
</para>
|
|
|
|
</section>
|
2004-11-13 22:28:28 +00:00
|
|
|
<section id="pdo.drivers">
|
|
|
|
<title>PDO Drivers</title>
|
|
|
|
<para>
|
|
|
|
The following drivers currently implement the PDO interface:
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_FIREBIRD - Firebird/Interbase 6
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_MYSQL - MySQL 3.x/4.0
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_OCI - Oracle Call Interface
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_ODBC - ODBC v3 (IBM DB2 and unixODBC)
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_PGSQL - PostgreSQL
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2004-11-16 20:12:45 +00:00
|
|
|
PDO_SQLITE - SQLite 3.x
|
2004-11-13 22:28:28 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
</section>
|
|
|
|
|
2004-11-10 22:21:24 +00:00
|
|
|
<section id='pdo.classes'>
|
|
|
|
&reftitle.classes;
|
|
|
|
<section id='pdo.class.PDO'>
|
|
|
|
<title><classname>PDO</classname></title>
|
|
|
|
<para>
|
|
|
|
Represents a connection between PHP and a database server.
|
|
|
|
</para>
|
|
|
|
<section id='pdo.class.PDO.constructor'>
|
|
|
|
&reftitle.constructor;
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-construct'>PDO</link> - constructs a new PDO
|
2004-11-11 08:16:32 +00:00
|
|
|
object</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</section>
|
|
|
|
<section id='pdo.class.PDO.methods'>
|
|
|
|
&reftitle.methods;
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-beginTransaction'>beginTransaction
|
2004-11-11 08:16:32 +00:00
|
|
|
</link> - begins a transaction</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-commit'>commit</link> - commits a
|
2004-11-11 08:16:32 +00:00
|
|
|
transaction</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-exec'>exec</link> - issues an SQL
|
2004-11-11 08:16:32 +00:00
|
|
|
statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-errorCode'>errorCode</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
retrieves an error code, if any, from the database</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-errorInfo'>errorInfo</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
retrieves an array of error information, if any, from the
|
|
|
|
database</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-lastInsertId'>lastInsertId</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
retrieves the value of the last row that was inserted into a
|
|
|
|
table</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-prepare'>prepare</link> - prepares
|
2004-11-11 08:16:32 +00:00
|
|
|
an SQL statement for execution</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-rollBack'>rollBack</link> - roll
|
2004-11-11 08:16:32 +00:00
|
|
|
back a transaction</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDO-setAttribute'>setAttribute</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
sets a database connection attribute</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section id='pdo.class.PDOStatement'>
|
|
|
|
<title><classname>PDOStatement</classname></title>
|
|
|
|
<para>Represents a prepared statement and, after the statement is
|
|
|
|
executed, an associated result set.</para>
|
|
|
|
<section id='pdo.class.Statement.methods'>
|
|
|
|
&reftitle.methods;
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-bindColumn'>bindColumn</link> - binds a
|
2004-11-11 08:16:32 +00:00
|
|
|
PHP variable to an output column in a result set</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-bindParam'>bindParam</link> - binds a
|
2004-11-11 08:16:32 +00:00
|
|
|
PHP variable to a parameter in the prepared statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-errorCode'>errorCode</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
retrieves an error code, if any, from the statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-errorInfo'>errorInfo</link> -
|
2004-11-11 08:16:32 +00:00
|
|
|
retrieves an array of error information, if any, from the statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-execute'>execute</link> - executes a
|
2004-11-11 08:16:32 +00:00
|
|
|
prepared statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-fetch'>fetch</link> - fetches a
|
2004-11-11 08:16:32 +00:00
|
|
|
row from a result set</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-fetchAll'>fetchAll</link> - fetches an
|
2004-11-11 08:16:32 +00:00
|
|
|
array containing all of the rows from a result set</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-fetchSingle'>fetchSingle</link> - returns
|
2004-11-11 08:16:32 +00:00
|
|
|
the data from the first column in a result set</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2004-11-11 16:57:17 +00:00
|
|
|
<para><link linkend='function.PDOStatement-rowCount'>rowCount</link> - returns the
|
2004-11-11 08:16:32 +00:00
|
|
|
number of rows that were affected by the execution of an SQL statement</para>
|
2004-11-10 22:21:24 +00:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</section>
|
2004-11-10 05:26:38 +00:00
|
|
|
</section>
|
|
|
|
</section>
|
2004-11-10 22:21:24 +00:00
|
|
|
&reference.pdo.constants;
|
|
|
|
</partintro>
|
2004-11-10 05:26:38 +00:00
|
|
|
&reference.pdo.functions;
|
2004-11-10 22:21:24 +00:00
|
|
|
</reference>
|
2004-11-10 05:26:38 +00:00
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|