<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set a statement attribute</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="pdostatement.rowcount.html">PDOStatement::rowCount</a></div> <div class="next" style="text-align: right; float: right;"><a href="pdostatement.setfetchmode.html">PDOStatement::setFetchMode</a></div> <div class="up"><a href="class.pdostatement.html">PDOStatement</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="pdostatement.setattribute" class="refentry"> <div class="refnamediv"> <h1 class="refname">PDOStatement::setAttribute</h1> <p class="verinfo">(PHP 5 >= 5.1.0, PECL pdo >= 0.2.0)</p><p class="refpurpose"><span class="refname">PDOStatement::setAttribute</span> — <span class="dc-title"> Set a statement attribute </span></p> </div> <div class="refsect1 description" id="refsect1-pdostatement.setattribute-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>PDOStatement::setAttribute</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span> , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></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="para"><em>PDO::ATTR_CURSOR_NAME</em> (Firebird and ODBC specific): Set the name of cursor for <em>UPDATE ... WHERE CURRENT OF</em>. </p></li> </ul> </p> </div> <div class="refsect1 returnvalues" id="refsect1-pdostatement.setattribute-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 seealso" id="refsect1-pdostatement.setattribute-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="pdo.getattribute.html" class="function" rel="rdfs-seeAlso">PDO::getAttribute()</a> - Retrieve a database connection attribute</span></li> <li class="member"> <span class="function"><a href="pdo.setattribute.html" class="function" rel="rdfs-seeAlso">PDO::setAttribute()</a> - Set an attribute</span></li> <li class="member"> <span class="function"><a href="pdostatement.getattribute.html" class="function" rel="rdfs-seeAlso">PDOStatement::getAttribute()</a> - Retrieve a statement attribute</span></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="pdostatement.rowcount.html">PDOStatement::rowCount</a></div> <div class="next" style="text-align: right; float: right;"><a href="pdostatement.setfetchmode.html">PDOStatement::setFetchMode</a></div> <div class="up"><a href="class.pdostatement.html">PDOStatement</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>