Atenção |
Este módulo é EXPERIMENTAL. Isso quer dizer que o comportamento neste módulo --- incluindo suas funções e seus nomes, e TUDO mais que está documentado sobre esse módulo --- poderá mudar em futuras versões do PHP, SEM QUALQUER NOTIFICAÇÃO. Esteja avisado, e use este módulo por sua própria conta e risco. |
PDO is currently available as a PECL extension from http://pecl.php.net/package/pdo. Ensure you have installed the CGI version of PHP and that the pear and phpize scripts are available in your current path.
Run the following command to download, build, and install the latest stable version of PDO:
pear install pdo |
Windows users can download the extension DLL php_pdo.dll as part of the PECL collection binaries from http://www.php.net/downloads.php.
The pear command automatically installs the PDO module into your PHP extensions directory. To enable the PDO extension on Linux or Unix operating systems, you must add the following line to php.ini:
extension=pdo.so |
extension=php_pdo.dll |
The following drivers currently implement the PDO interface:
Represents a connection between PHP and a database server.
PDO - constructs a new PDO object
beginTransaction - begins a transaction
commit - commits a transaction
exec - issues an SQL statement
errorCode - retrieves an error code, if any, from the database
errorInfo - retrieves an array of error information, if any, from the database
lastInsertId - retrieves the value of the last row that was inserted into a table
prepare - prepares an SQL statement for execution
rollBack - roll back a transaction
setAttribute - sets a database connection attribute
Represents a prepared statement and, after the statement is executed, an associated result set.
bindColumn - binds a PHP variable to an output column in a result set
bindParam - binds a PHP variable to a parameter in the prepared statement
errorCode - retrieves an error code, if any, from the statement
errorInfo - retrieves an array of error information, if any, from the statement
execute - executes a prepared statement
fetch - fetches a row from a result set
fetchAll - fetches an array containing all of the rows from a result set
fetchSingle - returns the data from the first column in a result set
rowCount - returns the number of rows that were affected by the execution of an SQL statement
As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução.