downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/class.pdo.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/book.pdo.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'class.pdo.php',
   
1 => 'PDO',
  ),
 
'up' =>
  array (
   
0 => 'book.pdo.php',
   
1 => 'PHP Data Objects',
  ),
 
'prev' =>
  array (
   
0 => 'pdo.lobs.php',
   
1 => 'Large Objects (LOBs)',
  ),
 
'next' =>
  array (
   
0 => 'pdo.begintransaction.php',
   
1 => 'PDO::beginTransaction',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div>
 <h1 class="title">The PDO class</h1>
 
 
 <div class="partintro">
 

  <div id="pdo.intro" class="section">
   <h2 class="title">Introduction</h2>
   <p class="para">
    Represents a connection between PHP and a database server.
   </p>
  </div>

 
  <div id="pdo.synopsis" class="section">
   <h2 class="title">Class synopsis</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"><b class="classname">PDO</b></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <b class="classname">PDO</b>
     </span>
     {</div>

 
    <div class="constructorsynopsis dc-description">
    <span class="methodname"><a href="pdo.construct.php" class="function">__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$dsn</tt></span>
   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$username</tt></span>
   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$password</tt></span>
   [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$driver_options</tt></span>
  ]]] )</div>

    <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><a href="pdo.begintransaction.php" class="function">beginTransaction</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><a href="pdo.commit.php" class="function">commit</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">mixed</span> <span class="methodname"><a href="pdo.errorcode.php" class="function">errorCode</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><a href="pdo.errorinfo.php" class="function">errorInfo</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><a href="pdo.exec.php" class="function">exec</a></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$statement</tt></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">mixed</span> <span class="methodname"><a href="pdo.getattribute.php" class="function">getAttribute</a></span>
    ( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$attribute</tt></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><a href="pdo.getavailabledrivers.php" class="function">getAvailableDrivers</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><a href="pdo.lastinsertid.php" class="function">lastInsertId</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$name</tt><span class="initializer"> = NULL</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">PDOStatement</span> <span class="methodname"><a href="pdo.prepare.php" class="function">prepare</a></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$statement</tt></span>
   [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$driver_options</tt><span class="initializer"> = array()</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">PDOStatement</span> <span class="methodname"><a href="pdo.query.php" class="function">query</a></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$statement</tt></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><a href="pdo.quote.php" class="function">quote</a></span>
    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$string</tt></span>
   [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$parameter_type</tt><span class="initializer"> = PDO::PARAM_STR</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><a href="pdo.rollback.php" class="function">rollBack</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><a href="pdo.setattribute.php" class="function">setAttribute</a></span>
    ( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$attribute</tt></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.php#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$value</tt></span>
   )</div>


 
   }</div>
  </div>
 
 </div>
 
 




















































































 
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="pdo.begintransaction.php">PDO::beginTransaction</a> — Initiates a transaction</li><li><a href="pdo.commit.php">PDO::commit</a> — Commits a transaction</li><li><a href="pdo.construct.php">PDO::__construct</a> — Creates a PDO instance representing a connection to a database</li><li><a href="pdo.errorcode.php">PDO::errorCode</a> — Fetch the SQLSTATE associated with the last operation on the database handle</li><li><a href="pdo.errorinfo.php">PDO::errorInfo</a> — Fetch extended error information associated with the last operation on the database handle</li><li><a href="pdo.exec.php">PDO::exec</a> — Execute an SQL statement and return the number of affected rows</li><li><a href="pdo.getattribute.php">PDO::getAttribute</a> — Retrieve a database connection attribute</li><li><a href="pdo.getavailabledrivers.php">PDO::getAvailableDrivers</a> — Return an array of available PDO drivers</li><li><a href="pdo.lastinsertid.php">PDO::lastInsertId</a> — Returns the ID of the last inserted row or sequence value</li><li><a href="pdo.prepare.php">PDO::prepare</a> — Prepares a statement for execution and returns a statement object</li><li><a href="pdo.query.php">PDO::query</a> — Executes an SQL statement, returning a result set as a PDOStatement object</li><li><a href="pdo.quote.php">PDO::quote</a> — Quotes a string for use in a query.</li><li><a href="pdo.rollback.php">PDO::rollBack</a> — Rolls back a transaction</li><li><a href="pdo.setattribute.php">PDO::setAttribute</a> — Set an attribute</li></ul>
</div>
<?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites