<HTML ><HEAD ><TITLE >dbx functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Function Reference" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="dbmreplace" HREF="function.dbmreplace.html"><LINK REL="NEXT" TITLE="dbx_close" HREF="function.dbx-close.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.dbmreplace.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.dbx-close.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.dbx" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >XXI. dbx functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN17628" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="dbx.intro" ></A >Introduction</H1 ><P > The dbx module is a database abstraction layer (db 'X', where 'X' is a supported database). The dbx functions allow you to access all supported databases using a single calling convention. The dbx-functions themselves do not interface directly to the databases, but interface to the modules that are used to support these databases. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="dbx.required" ></A >Requirements</H1 ><P > To be able to use a database with the dbx-module, the module must be either linked or loaded into PHP, and the database module must be supported by the dbx-module. Currently, following databases are supported, but others will follow: <P ></P ><UL ><LI ><P > <A HREF="ref.fbsql.html" >FrontBase</A > (available from PHP 4.1.0). </P ></LI ><LI ><P > <A HREF="ref.mssql.html" >Microsoft SQL Server</A > </P ></LI ><LI ><P > <A HREF="ref.mysql.html" >MySQL</A > </P ></LI ><LI ><P > <A HREF="ref.odbc.html" >ODBC</A > </P ></LI ><LI ><P > <A HREF="ref.pgsql.html" >PostgreSQL</A > </P ></LI ><LI ><P > <A HREF="ref.sybase.html" >Sybase-CT</A > (available from PHP 4.2.0). </P ></LI ><LI ><P > <A HREF="ref.oci8.html" >Oracle (oci8)</A > (available from PHP 4.3.0). </P ></LI ></UL > </P ><P > Documentation for adding additional database support to dbx can be found at <A HREF="http://www.guidance.nl/php/dbx/doc/" TARGET="_top" >http://www.guidance.nl/php/dbx/doc/</A >. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="dbx.installation" ></A >Installation</H1 ><P > In order to have these functions available, you must compile PHP with dbx support by using the <TT CLASS="option" >--enable-dbx</TT > option and all options for the databases that will be used, e.g. for MySQL you must also specify <TT CLASS="option" >--with-mysql=[DIR]</TT >. To get other supported databases to work with the dbx-module refer to their specific documentation. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="dbx.configuration" ></A >Runtime Configuration</H1 ><P > The behaviour of these functions is affected by settings in <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN17669" ></A ><P ><B >Table 1. DBX Configuration Options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Name</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Default</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Changeable</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >dbx.colnames_case</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >"unchanged"</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_SYSTEM</TD ></TR ></TBODY ></TABLE ></DIV > For further details and definition of the PHP_INI_* constants see <A HREF="function.ini-set.html" ><B CLASS="function" >ini_set()</B ></A >. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Note: </B > This ini-option is available available from PHP 4.3.0. </P ></BLOCKQUOTE ></DIV ><P > Here is a short explanation of the configuration directives. <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.dbx.colnames-case" ></A ><TT CLASS="parameter" ><I >dbx.colnames_case</I ></TT > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Columns names can be returned "unchanged" or converted to "uppercase" or "lowercase". This directive can be overridden with a flag to <A HREF="function.dbx-query.html" ><B CLASS="function" >dbx_query()</B ></A >. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="dbx.resources" ></A >Resource Types</H1 ><P > There are two resource types used in the dbx module. The first one is the link-<A HREF="language.types.object.html" ><B CLASS="type" >object</B ></A > for a database connection, the second a result-<A HREF="language.types.object.html" ><B CLASS="type" >object</B ></A > which helds the result of a query. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="constants.dbx" ></A >Predefined Constants</H1 ><P > 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 ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >DBX_MYSQL</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_ODBC</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_PGSQL</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_MSSQL</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_FBSQL</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_OCI8</B ></TT > (<A HREF="language.types.integer.html" >integer</A >) (available from PHP 4.3.0)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_SYBASECT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_PERSISTENT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_RESULT_INFO</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_RESULT_INDEX</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_RESULT_ASSOC</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_COLNAMES_UNCHANGED</B ></TT > (<A HREF="language.types.integer.html" >integer</A >) (available from PHP 4.3.0)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_COLNAMES_UPPERCASE</B ></TT > (<A HREF="language.types.integer.html" >integer</A >) (available from PHP 4.3.0)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_COLNAMES_LOWERCASE</B ></TT > (<A HREF="language.types.integer.html" >integer</A >) (available from PHP 4.3.0)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_CMP_NATIVE</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_CMP_TEXT</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_CMP_NUMBER</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_CMP_ASC</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >DBX_CMP_DESC</B ></TT > (<A HREF="language.types.integer.html" >integer</A >)</DT ><DD ><P > </P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="function.dbx-close.html" >dbx_close</A > -- Close an open connection/database</DT ><DT ><A HREF="function.dbx-compare.html" >dbx_compare</A > -- Compare two rows for sorting purposes</DT ><DT ><A HREF="function.dbx-connect.html" >dbx_connect</A > -- Open a connection/database</DT ><DT ><A HREF="function.dbx-error.html" >dbx_error</A > -- Report the error message of the latest function call in the module (not just in the connection) </DT ><DT ><A HREF="function.dbx-escape-string.html" >dbx_escape_string</A > -- Escape a string so it can safely be used in an sql-statement. </DT ><DT ><A HREF="function.dbx-query.html" >dbx_query</A > -- Send a query and fetch all results (if any)</DT ><DT ><A HREF="function.dbx-sort.html" >dbx_sort</A > -- Sort a result from a dbx_query by a custom sort function </DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.dbmreplace.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.dbx-close.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >dbmreplace</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >dbx_close</TD ></TR ></TABLE ></DIV ></BODY ></HTML >