CVS update: php3/doc/functions
| From: | eschmid | Date: | Mon, 04 Jan 1999 07:22:28 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3237@lists.php.net to get a copy of this message | ||
Date: Monday January 4, 1999 @ 2:22
Author: eschmid
Update of /repository/php3/doc/functions
In directory asf:/u/temp/cvs-serv29176
Modified Files:
uodbc.sgml
Log Message:
Added setoption
Index: php3/doc/functions/uodbc.sgml
diff -c php3/doc/functions/uodbc.sgml:1.18 php3/doc/functions/uodbc.sgml:1.19
*** php3/doc/functions/uodbc.sgml:1.18 Wed Dec 9 21:07:42 1998
--- php3/doc/functions/uodbc.sgml Mon Jan 4 02:22:26 1999
***************
*** 719,724 ****
--- 719,792 ----
</refsect1>
</refentry>
+ <refentry id="function.odbc-setoption">
+ <refnamediv>
+ <refname>odbc_setoption</refname>
+ <refpurpose>
+ Adjust ODBC settings. Returns false if an error occurs, otherwise
+ true.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>int <function>odbc_setoption</function></funcdef>
+ <paramdef>int <parameter>id</parameter></paramdef>
+ <paramdef>int <parameter>function</parameter></paramdef>
+ <paramdef>int <parameter>option</parameter></paramdef>
+ <paramdef>int <parameter>param</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ This function allows fiddling with the ODBC options for a
+ particular connection or query result. It was written to help
+ find work arounds to problems in quirky ODBC drivers. You
+ should probably only use this function if you are an ODBC
+ programmer and understand the effects the various options will
+ have. You will certainly need a good ODBC reference to explain
+ all the different options and values that can be used.
+ Different driver versions support different options.
+ <para>
+ Because the effects may vary depending on the ODBC driver, use
+ of this function in scripts to be made publicly available is
+ strongly discouraged. Also, some ODBC options are not available
+ to this function because they must be set before the connection
+ is established or the query is prepared. However, if on a
+ particular job it can make PHP work so your boss doesn't tell
+ you to use a commercial product, that's all that really matters.
+ <para>
+ <parameter>Id</parameter> is a connection id or result id on
+ which to change the settings.For SQLSetConnectOption(), this is
+ a connection id. For SQLSetStmtOption(), this is a result id.
+ <para>
+ <parameter>function</parameter> is the ODBC function to use. The
+ value should be 1 for SQLSetConnectOption() and 2 for
+ SQLSetStmtOption().
+ <para>
+ Parmeter <parameter>option</parameter> is the option to set.
+ <para>
+ Parameter <parameter>param</parameter> is the value for the
+ given <parameter>option</parameter>.
+
+ <example>
+ <title>ODBC Setoption Examples</title>
+ <programlisting role="php">
+ // 1. Option 102 of SQLSetConnectOption() is SQL_AUTOCOMMIT.
+ // Value 1 of SQL_AUTOCOMMIT is SQL_AUTOCOMMIT_ON.
+ // This example has the same effect as
+ // odbc_autocommit($conn, true);
+
+ odbc_setoption ($conn, 1, 102, 1);
+
+ // 2. Option 0 of SQLSetStmtOption() is SQL_QUERY_TIMEOUT.
+ // This example sets the query to timeout after 30 seconds.
+
+ $result = odbc_prepare ($conn, $sql);
+ odbc_setoption ($result, 2, 0, 30);
+ odbc_execute ($result);
+ </programlisting>
+ </example>
+ </refsect1>
+ </refentry>
</reference>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net