Query/apiDocumentation/classes/PDO/setAttribute.html

104 lines
5.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>phpDox - PDO::setAttribute</title>
<link rel="stylesheet" type="text/css" href="../../css/style.css" media="screen"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
<body>
<nav class="topnav">
<ul>
<li>
<div class="logo"><span>/**</span>phpDox</div>
</li>
<li class="separator">
<a href="../../index.html">Overview</a>
</li>
<li class="separator">
<a href="../../namespaces.html">Namespaces</a>
</li>
<li>
<a href="../../interfaces.html">Interfaces</a>
</li>
<li>
<a href="../../classes.html">Classes</a>
</li>
<li class="separator">
<a href="../../source/index.html">Source</a>
</li>
</ul>
</nav>
<div id="mainstage">
<div class="box">
<ul class="breadcrumb">
<li>
<a href="../../index.html">Overview</a>
</li>
<li class="separator">
<a href="../../classes.html">Classes</a>
</li>
<li class="separator">
<a href="../../classes.html#"/>
</li>
<li class="separator">
<a title="PDO" href="../../classes/PDO.html">PDO</a>
</li>
<li class="separator">setAttribute</li>
</ul>
</div>
<nav class="box">
<ul>
<li>
<a href="#introduction">Introduction</a>
</li>
<li>
<a href="#synopsis">Synopsis</a>
</li>
<li>
<a href="#parameter">Parameter</a>
</li>
<li>
<a href="#return">Return</a>
</li>
</ul>
</nav>
<section>
<h1><small>PDO::</small>setAttribute</h1>
<h4>
Set an attribute
</h4>
<p>Sets an attribute on the database handle. Some of the available generic attributes are listed below; some drivers may make use of additional driver specific attributes. PDO::ATTR_CASE: Force column names to a specific case. PDO::CASE_LOWER: Force column names to lower case. PDO::CASE_NATURAL: Leave column names as returned by the database driver. PDO::CASE_UPPER: Force column names to upper case. PDO::ATTR_ERRMODE: Error reporting. PDO::ERRMODE_SILENT: Just set error codes. PDO::ERRMODE_WARNING: Raise E_WARNING. PDO::ERRMODE_EXCEPTION: Throw exceptions. PDO::ATTR_ORACLE_NULLS (available with all drivers, not just Oracle): Conversion of NULL and empty strings. PDO::NULL_NATURAL: No conversion. PDO::NULL_EMPTY_STRING: Empty string is converted to NULL. PDO::NULL_TO_STRING: NULL is converted to an empty string. PDO::ATTR_STRINGIFY_FETCHES: Convert numeric values to strings when fetching. Requires bool. PDO::ATTR_STATEMENT_CLASS: Set user-supplied statement class derived from PDOStatement. Cannot be used with persistent PDO instances. Requires array(string classname, array(mixed constructor_args)). PDO::ATTR_TIMEOUT: Specifies the timeout duration in seconds. Not all drivers support this option, and its meaning may differ from driver to driver. For example, sqlite will wait for up to this time value before giving up on obtaining an writable lock, but other drivers may interpret this as a connect or a read timeout interval. Requires int. PDO::ATTR_AUTOCOMMIT (available in OCI, Firebird and MySQL): Whether to autocommit every single statement. PDO::ATTR_EMULATE_PREPARES Enables or disables emulation of prepared statements. Some drivers do not support native prepared statements or have limited support for them. Use this setting to force PDO to either always emulate prepared statements (if TRUE and emulated prepares are supported by the driver), or to try to use native prepared statements (if FALSE). It will always fall back to emulating the prepared statement if the driver cannot successfully prepare the current query. Requires bool. PDO::MYSQL_ATTR_USE_BUFFERED_QUERY (available in MySQL): Use buffered queries. PDO::ATTR_DEFAULT_FETCH_MODE: Set default fetch mode. Description of modes is available in PDOStatement::fetch documentation.</p>
<ul/>
<h2 id="signature">Signature</h2>
<div class="styled synopsis">
<code>public function setAttribute(int
$attribute,
<a title="" href="../../classes/.html"/>
$value )
</code>
</div>
<h2 id="parameterlist">Parameters</h2>
<dl class="styled">
<dt><code>$attribute</code>
int</dt>
<dd/>
<dt><code>$value</code>
<a title="" href="../../classes/.html"/></dt>
<dd/>
</dl>
<h2 id="return">Returns</h2>
<dl class="styled">
<dt>bool</dt>
<dd/>
</dl>
</section>
</div>
<footer>
<span>Generated using phpDox 0.11.0-dev - Copyright (C) 2010 - 2018 by Arne Blankerts and Contributors</span>
</footer>
</body>
</html>