Source of: /manual/en/class.pdostatement.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.pdostatement.php',
1 => 'PDOStatement',
),
'up' =>
array (
0 => 'book.pdo.php',
1 => 'PHP Data Objects',
),
'prev' =>
array (
0 => 'pdo.setattribute.php',
1 => 'PDO::setAttribute',
),
'next' =>
array (
0 => 'pdostatement.bindcolumn.php',
1 => 'PDOStatement->bindColumn',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div>
<h1 class="title">The PDOStatement class</h1>
<div class="partintro">
<div id="pdostatement.intro" class="section">
<h2 class="title">Introduction</h2>
<p class="para">
Represents a prepared statement and, after the statement is executed, an
associated result set.
</p>
</div>
<div id="pdostatement.synopsis" class="section">
<h2 class="title">Class synopsis</h2>
<div class="classsynopsis">
<div class="ooclass"><b class="classname">PDOStatement</b></div>
<div class="classsynopsisinfo">
<span class="ooclass">
<b class="classname">PDOStatement</b>
</span>
<span class="oointerface">implements
<a href="class.traversable.php" class="interfacename">Traversable</a>
</span>
{</div>
<div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div>
<div class="fieldsynopsis"><span class="modifier">readonly</span><span class="type">string</span> <var class="varname"><a href="class.pdostatement.php#pdostatement.props.querystring">$queryString</a></var>;</div>
<div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.bindcolumn.php" class="function">bindColumn</a></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">$column</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 reference">&$param</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$type</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$maxlen</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">$driverdata</tt></span>
]]] )</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.bindparam.php" class="function">bindParam</a></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">$parameter</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 reference">&$variable</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$data_type</tt></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$length</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">$driver_options</tt></span>
]]] )</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.bindvalue.php" class="function">bindValue</a></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">$parameter</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>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$data_type</tt></span>
] )</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.closecursor.php" class="function">closeCursor</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><a href="pdostatement.columncount.php" class="function">columnCount</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.debugdumpparams.php" class="function">debugDumpParams</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">string</span> <span class="methodname"><a href="pdostatement.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="pdostatement.errorinfo.php" class="function">errorInfo</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.execute.php" class="function">execute</a></span>
([ <span class="methodparam"><span class="type">array</span> <tt class="parameter">$input_parameters</tt><span class="initializer"> = array()</span></span>
] )</div>
<div class="methodsynopsis dc-description">
<span class="type">mixed</span> <span class="methodname"><a href="pdostatement.fetch.php" class="function">fetch</a></span>
([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$fetch_style</tt><span class="initializer"> = PDO::FETCH_BOTH</span></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$cursor_orientation</tt><span class="initializer"> = PDO::FETCH_ORI_NEXT</span></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$cursor_offset</tt><span class="initializer"> = 0</span></span>
]]] )</div>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><a href="pdostatement.fetchall.php" class="function">fetchAll</a></span>
([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$fetch_style</tt><span class="initializer"> = PDO::FETCH_BOTH</span></span>
[, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$column_index</tt></span>
[, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$ctor_args</tt><span class="initializer"> = array()</span></span>
]]] )</div>
<div class="methodsynopsis dc-description">
<span class="type">string</span> <span class="methodname"><a href="pdostatement.fetchcolumn.php" class="function">fetchColumn</a></span>
([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$column_number</tt><span class="initializer"> = 0</span></span>
] )</div>
<div class="methodsynopsis dc-description">
<span class="type">mixed</span> <span class="methodname"><a href="pdostatement.fetchobject.php" class="function">fetchObject</a></span>
([ <span class="methodparam"><span class="type">string</span> <tt class="parameter">$class_name</tt></span>
[, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$ctor_args</tt></span>
]] )</div>
<div class="methodsynopsis dc-description">
<span class="type">mixed</span> <span class="methodname"><a href="pdostatement.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="pdostatement.getcolumnmeta.php" class="function">getColumnMeta</a></span>
( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$column</tt></span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.nextrowset.php" class="function">nextRowset</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><a href="pdostatement.rowcount.php" class="function">rowCount</a></span>
( <span class="methodparam">void</span>
)</div>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.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 class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><a href="pdostatement.setfetchmode.php" class="function">setFetchMode</a></span>
( <span class="methodparam"><span class="type">int</span> <tt class="parameter">$mode</tt></span>
)</div>
}</div>
</div>
<div id="pdostatement.props" class="section">
<h2 class="title">Properties</h2>
<dl>
<dt id="pdostatement.props.querystring" class="varlistentry">
<span class="term"><var class="varname">queryString</var></span>
</dt><dd class="listitem">
<p class="para">
Used query string.
</p>
</dd>
</dl>
</div>
</div>
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="pdostatement.bindcolumn.php">PDOStatement->bindColumn</a> — Bind a column to a PHP variable</li><li><a href="pdostatement.bindparam.php">PDOStatement->bindParam</a> — Binds a parameter to the specified variable name</li><li><a href="pdostatement.bindvalue.php">PDOStatement->bindValue</a> — Binds a value to a parameter</li><li><a href="pdostatement.closecursor.php">PDOStatement->closeCursor</a> — Closes the cursor, enabling the statement to be executed again.</li><li><a href="pdostatement.columncount.php">PDOStatement->columnCount</a> — Returns the number of columns in the result set</li><li><a href="pdostatement.debugdumpparams.php">PDOStatement->debugDumpParams</a> — Dump a SQL prepared command</li><li><a href="pdostatement.errorcode.php">PDOStatement->errorCode</a> — Fetch the SQLSTATE associated with the last operation on the statement handle</li><li><a href="pdostatement.errorinfo.php">PDOStatement->errorInfo</a> — Fetch extended error information associated with the last operation on the statement handle</li><li><a href="pdostatement.execute.php">PDOStatement->execute</a> — Executes a prepared statement</li><li><a href="pdostatement.fetch.php">PDOStatement->fetch</a> — Fetches the next row from a result set</li><li><a href="pdostatement.fetchall.php">PDOStatement->fetchAll</a> — Returns an array containing all of the result set rows</li><li><a href="pdostatement.fetchcolumn.php">PDOStatement->fetchColumn</a> — Returns a single column from the next row of a result set</li><li><a href="pdostatement.fetchobject.php">PDOStatement->fetchObject</a> — Fetches the next row and returns it as an object.</li><li><a href="pdostatement.getattribute.php">PDOStatement->getAttribute</a> — Retrieve a statement attribute</li><li><a href="pdostatement.getcolumnmeta.php">PDOStatement->getColumnMeta</a> — Returns metadata for a column in a result set</li><li><a href="pdostatement.nextrowset.php">PDOStatement->nextRowset</a> — Advances to the next rowset in a multi-rowset statement handle</li><li><a href="pdostatement.rowcount.php">PDOStatement->rowCount</a> — Returns the number of rows affected by the last SQL statement</li><li><a href="pdostatement.setattribute.php">PDOStatement->setAttribute</a> — Set a statement attribute</li><li><a href="pdostatement.setfetchmode.php">PDOStatement->setFetchMode</a> — Set the default fetch mode for this statement</li></ul>
</div>
<?php manual_footer(); ?>