<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.pdostatement.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'pdostatement.setattribute.php',
    1 => 'PDOStatement::setAttribute',
    2 => 'Set a statement attribute',
  ),
  'up' => 
  array (
    0 => 'class.pdostatement.php',
    1 => 'PDOStatement',
  ),
  'prev' => 
  array (
    0 => 'pdostatement.rowcount.php',
    1 => 'PDOStatement::rowCount',
  ),
  'next' => 
  array (
    0 => 'pdostatement.setfetchmode.php',
    1 => 'PDOStatement::setFetchMode',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pdo/pdostatement/setattribute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="pdostatement.setattribute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDOStatement::setAttribute</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8, PECL pdo &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">PDOStatement::setAttribute</span> &mdash; <span class="dc-title">
   Set a statement attribute
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-pdostatement.setattribute-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>PDOStatement::setAttribute</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$attribute</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="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>


  <p class="para rdfs-comment">
   Sets an attribute on the statement. Currently, no generic attributes are set but only driver specific:
   <ul class="itemizedlist">
    <li class="listitem">
     <p class="simpara">
      <strong><code><a href="pdo.constants.php#pdo.constants.attr-cursor-name">PDO::ATTR_CURSOR_NAME</a></code></strong>
      (Firebird and ODBC specific):
      Set the name of the cursor for <code class="literal">UPDATE ... WHERE CURRENT OF</code>.
     </p>
    </li>
   </ul>
   Note that driver specific attributes <em>must not</em> be used
   with other drivers.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-pdostatement.setattribute-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">attribute</code></dt>
     <dd>
      <p class="para">
       The attribute to modify.
      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       The value to set the <code class="parameter">attribute</code>,
       might require a specific type depending on the attribute.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-pdostatement.setattribute-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-pdostatement.setattribute-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="simpara">
   As of PHP 8.5.0, when using the Firebird driver, a
   <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> is thrown if the cursor name set via
   <strong><code><a href="pdo.constants.php#pdo.constants.attr-cursor-name">PDO::ATTR_CURSOR_NAME</a></code></strong> is too long.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-pdostatement.setattribute-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.5.0</td>
      <td>
       When using the Firebird driver, a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span>
       is now thrown if the cursor name set via
       <strong><code><a href="pdo.constants.php#pdo.constants.attr-cursor-name">PDO::ATTR_CURSOR_NAME</a></code></strong> is too long.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-pdostatement.setattribute-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="pdo.getattribute.php" class="methodname" rel="rdfs-seeAlso">PDO::getAttribute()</a> - Retrieve a database connection attribute</span></li>
    <li><span class="methodname"><a href="pdo.setattribute.php" class="methodname" rel="rdfs-seeAlso">PDO::setAttribute()</a> - Set an attribute</span></li>
    <li><span class="methodname"><a href="pdostatement.getattribute.php" class="methodname" rel="rdfs-seeAlso">PDOStatement::getAttribute()</a> - Retrieve a statement attribute</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>