<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.sqlite3.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.sqlite3stmt.php',
    1 => 'SQLite3Stmt',
    2 => 'The SQLite3Stmt class',
  ),
  'up' => 
  array (
    0 => 'book.sqlite3.php',
    1 => 'SQLite3',
  ),
  'prev' => 
  array (
    0 => 'class.sqlite3exception.php',
    1 => 'SQLite3Exception',
  ),
  'next' => 
  array (
    0 => 'sqlite3stmt.bindparam.php',
    1 => 'SQLite3Stmt::bindParam',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sqlite3/sqlite3stmt.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.sqlite3stmt.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.sqlite3stmt" class="reference">
 <h1 class="title">The SQLite3Stmt class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p>


  <div class="section" id="sqlite3stmt.intro">
   <h2 class="title">Introduction</h2>
   <p class="simpara">
    A class that handles prepared statements for the SQLite 3 extension.
    Instances are obtained from <span class="methodname"><a href="sqlite3.prepare.php" class="methodname">SQLite3::prepare()</a></span>.
    Calling <span class="methodname"><a href="sqlite3stmt.execute.php" class="methodname">SQLite3Stmt::execute()</a></span> runs the query and
    returns a <span class="classname"><a href="class.sqlite3result.php" class="classname">SQLite3Result</a></span> for result sets.
   </p>
  </div>


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


   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">class</span> <strong class="classname"><strong class="classname">SQLite3Stmt</strong></strong>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-prepared"><var class="varname">EXPLAIN_MODE_PREPARED</var></a></var><span class="initializer"> = 0</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-explain"><var class="varname">EXPLAIN_MODE_EXPLAIN</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-explain-query-plan"><var class="varname">EXPLAIN_MODE_EXPLAIN_QUERY_PLAN</var></a></var><span class="initializer"> = 2</span>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">private</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><a href="class.sqlite3.php" class="type SQLite3">SQLite3</a></span> <code class="parameter">$sqlite3</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$query</code></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.bindparam.php" class="methodname">bindParam</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$param</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter reference">&$var</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code><span class="initializer"> = <strong><code><a href="sqlite3.constants.php#constant.sqlite3-text">SQLITE3_TEXT</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.bindvalue.php" class="methodname">bindValue</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$param</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code><span class="initializer"> = <strong><code><a href="sqlite3.constants.php#constant.sqlite3-text">SQLITE3_TEXT</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.busy.php" class="methodname">busy</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.clear.php" class="methodname">clear</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.close.php" class="methodname">close</a></span>(): <span class="type"><a href="language.types.singleton.php" class="type true">true</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.execute.php" class="methodname">execute</a></span>(): <span class="type"><span class="type"><a href="class.sqlite3result.php" class="type SQLite3Result">SQLite3Result</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.explain.php" class="methodname">explain</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.getsql.php" class="methodname">getSQL</a></span>(<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$expand</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.paramcount.php" class="methodname">paramCount</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.readonly.php" class="methodname">readOnly</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.reset.php" class="methodname">reset</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><a href="sqlite3stmt.setexplain.php" class="methodname">setExplain</a></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$mode</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

   }</div>


  </div>


  <div class="section" id="sqlite3stmt.constants">
   <h2 class="title">Predefined Constants</h2>
   <dl>

    
     <dt id="sqlite3stmt.constants.explain-mode-prepared"><strong><code><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-prepared">SQLite3Stmt::EXPLAIN_MODE_PREPARED</a></code></strong></dt>
     <dd>
      <p class="simpara">
       The statement operates in normal prepared statement mode (no <code class="literal">EXPLAIN</code>).
       Available as of PHP 8.5.0, when compiled against libsqlite &gt;= 3.43.0.
      </p>
     </dd>
    

    
     <dt id="sqlite3stmt.constants.explain-mode-explain"><strong><code><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-explain">SQLite3Stmt::EXPLAIN_MODE_EXPLAIN</a></code></strong></dt>
     <dd>
      <p class="simpara">
       The statement operates as if prefixed with <code class="literal">EXPLAIN</code>,
       returning opcode information from the virtual machine.
       Available as of PHP 8.5.0, when compiled against libsqlite &gt;= 3.43.0.
      </p>
     </dd>
    

    
     <dt id="sqlite3stmt.constants.explain-mode-explain-query-plan"><strong><code><a href="class.sqlite3stmt.php#sqlite3stmt.constants.explain-mode-explain-query-plan">SQLite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN</a></code></strong></dt>
     <dd>
      <p class="simpara">
       The statement operates as if prefixed with <code class="literal">EXPLAIN QUERY PLAN</code>,
       returning high-level query plan information.
       Available as of PHP 8.5.0, when compiled against libsqlite &gt;= 3.43.0.
      </p>
     </dd>
    

   </dl>
  </div>


 </div>

 
































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="sqlite3stmt.bindparam.php">SQLite3Stmt::bindParam</a> — Binds a parameter to a statement variable</li><li><a href="sqlite3stmt.bindvalue.php">SQLite3Stmt::bindValue</a> — Binds the value of a parameter to a statement variable</li><li><a href="sqlite3stmt.busy.php">SQLite3Stmt::busy</a> — Returns whether the statement has been fetched but not yet completed</li><li><a href="sqlite3stmt.clear.php">SQLite3Stmt::clear</a> — Clears all current bound parameters</li><li><a href="sqlite3stmt.close.php">SQLite3Stmt::close</a> — Closes the prepared statement</li><li><a href="sqlite3stmt.construct.php">SQLite3Stmt::__construct</a> — Constructs an SQLite3Stmt object</li><li><a href="sqlite3stmt.execute.php">SQLite3Stmt::execute</a> — Executes a prepared statement and returns a result set object</li><li><a href="sqlite3stmt.explain.php">SQLite3Stmt::explain</a> — Returns the explain mode of the statement</li><li><a href="sqlite3stmt.getsql.php">SQLite3Stmt::getSQL</a> — Get the SQL of the statement</li><li><a href="sqlite3stmt.paramcount.php">SQLite3Stmt::paramCount</a> — Returns the number of parameters within the prepared statement</li><li><a href="sqlite3stmt.readonly.php">SQLite3Stmt::readOnly</a> — Returns whether a statement is definitely read only</li><li><a href="sqlite3stmt.reset.php">SQLite3Stmt::reset</a> — Resets the prepared statement</li><li><a href="sqlite3stmt.setexplain.php">SQLite3Stmt::setExplain</a> — Changes the explain mode of the statement</li></ul>
</div>
<?php manual_footer($setup); ?>