<!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>Predefined Constants</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sqlite.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.sqlite.html">SQLite Functions</a></div> <div class="up"><a href="book.sqlite.html">SQLite</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="sqlite.constants" class="appendix"> <h1>Predefined Constants</h1> <p class="simpara"> The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. </p> <p class="para"> The functions <span class="function"><a href="function.sqlite-fetch-array.html" class="function">sqlite_fetch_array()</a></span> and <span class="function"><a href="function.sqlite-current.html" class="function">sqlite_current()</a></span> use a constant for the different types of result arrays. The following constants are defined: </p> <dl> <strong class="title">SQLite result type constants</strong> <dt id="constant.sqlite-assoc"> <span class="term"> <strong><code>SQLITE_ASSOC</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Columns are returned into the array having the field name as the array index. </span> </dd> </dt> <dt id="constant.sqlite-both"> <span class="term"> <strong><code>SQLITE_BOTH</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Columns are returned into the array having both a numerical index and the field name as the array index. </span> </dd> </dt> <dt id="constant.sqlite-num"> <span class="term"> <strong><code>SQLITE_NUM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Columns are returned into the array having a numerical index to the fields. This index starts with 0, the first field in the result. </span> </dd> </dt> </dl> <p class="para"> A number of functions may return status codes. The following constants are defined: </p> <dl> <strong class="title">SQLite status code constants</strong> <dt id="constant.sqlite-ok"> <span class="term"> <strong><code>SQLITE_OK</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Successful result. </span> </dd> </dt> <dt id="constant.sqlite-error"> <span class="term"> <strong><code>SQLITE_ERROR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> SQL error or missing database. </span> </dd> </dt> <dt id="constant.sqlite-internal"> <span class="term"> <strong><code>SQLITE_INTERNAL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> An internal logic error in SQLite. </span> </dd> </dt> <dt id="constant.sqlite-perm"> <span class="term"> <strong><code>SQLITE_PERM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Access permission denied. </span> </dd> </dt> <dt id="constant.sqlite-abort"> <span class="term"> <strong><code>SQLITE_ABORT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Callback routine requested an abort. </span> </dd> </dt> <dt id="constant.sqlite-busy"> <span class="term"> <strong><code>SQLITE_BUSY</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> The database file is locked. </span> </dd> </dt> <dt id="constant.sqlite-locked"> <span class="term"> <strong><code>SQLITE_LOCKED</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> A table in the database is locked. </span> </dd> </dt> <dt id="constant.sqlite-nomem"> <span class="term"> <strong><code>SQLITE_NOMEM</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Memory allocation failed. </span> </dd> </dt> <dt id="constant.sqlite-readonly"> <span class="term"> <strong><code>SQLITE_READONLY</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Attempt to write a readonly database. </span> </dd> </dt> <dt id="constant.sqlite-interrupt"> <span class="term"> <strong><code>SQLITE_INTERRUPT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Operation terminated internally. </span> </dd> </dt> <dt id="constant.sqlite-ioerr"> <span class="term"> <strong><code>SQLITE_IOERR</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Disk I/O error occurred. </span> </dd> </dt> <dt id="constant.sqlite-notadb"> <span class="term"> <strong><code>SQLITE_NOTADB</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> File opened that is not a database file. </span> </dd> </dt> <dt id="constant.sqlite-corrupt"> <span class="term"> <strong><code>SQLITE_CORRUPT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> The database disk image is malformed. </span> </dd> </dt> <dt id="constant.sqlite-format"> <span class="term"> <strong><code>SQLITE_FORMAT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Auxiliary database format error. </span> </dd> </dt> <dt id="constant.sqlite-notfound"> <span class="term"> <strong><code>SQLITE_NOTFOUND</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> (Internal) Table or record not found. </span> </dd> </dt> <dt id="constant.sqlite-full"> <span class="term"> <strong><code>SQLITE_FULL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Insertion failed because database is full. </span> </dd> </dt> <dt id="constant.sqlite-cantopen"> <span class="term"> <strong><code>SQLITE_CANTOPEN</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Unable to open the database file. </span> </dd> </dt> <dt id="constant.sqlite-protocol"> <span class="term"> <strong><code>SQLITE_PROTOCOL</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Database lock protocol error. </span> </dd> </dt> <dt id="constant.sqlite-empty"> <span class="term"> <strong><code>SQLITE_EMPTY</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> (Internal) Database table is empty. </span> </dd> </dt> <dt id="constant.sqlite-schema"> <span class="term"> <strong><code>SQLITE_SCHEMA</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> The database schema changed. </span> </dd> </dt> <dt id="constant.sqlite-toobig"> <span class="term"> <strong><code>SQLITE_TOOBIG</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Too much data for one row of a table. </span> </dd> </dt> <dt id="constant.sqlite-constraint"> <span class="term"> <strong><code>SQLITE_CONSTRAINT</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Abort due to constraint violation. </span> </dd> </dt> <dt id="constant.sqlite-mismatch"> <span class="term"> <strong><code>SQLITE_MISMATCH</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Data type mismatch. </span> </dd> </dt> <dt id="constant.sqlite-misuse"> <span class="term"> <strong><code>SQLITE_MISUSE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Library used incorrectly. </span> </dd> </dt> <dt id="constant.sqlite-nolfs"> <span class="term"> <strong><code>SQLITE_NOLFS</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Uses of OS features not supported on host. </span> </dd> </dt> <dt id="constant.sqlite-auth"> <span class="term"> <strong><code>SQLITE_AUTH</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Authorized failed. </span> </dd> </dt> <dt id="constant.sqlite-row"> <span class="term"> <strong><code>SQLITE_ROW</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Internal process has another row ready. </span> </dd> </dt> <dt id="constant.sqlite-done"> <span class="term"> <strong><code>SQLITE_DONE</code></strong> (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>) </span> <dd> <span class="simpara"> Internal process has finished executing. </span> </dd> </dt> </dl> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sqlite.resources.html">Resource Types</a></div> <div class="next" style="text-align: right; float: right;"><a href="ref.sqlite.html">SQLite Functions</a></div> <div class="up"><a href="book.sqlite.html">SQLite</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>