odbc_setoption
(PHP 4, PHP 5)
odbc_setoption — Adjust ODBC settings
Description
bool odbc_setoption
( resource $id
, int $function
, int $option
, int $param
)
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.
Parameters
-
id
-
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.
-
function
-
Is the ODBC function to use. The value should be
1 for SQLSetConnectOption() and
2 for SQLSetStmtOption().
-
option
-
The option to set.
-
param
-
The value for the given option
.
Return Values
Returns TRUE on success or FALSE on failure..
Examples
Example #1 odbc_setoption() examples
<?php
odbc_setoption($conn, 1, 102, 1);
$result = odbc_prepare($conn, $sql);
odbc_setoption($result, 2, 0, 30);
odbc_execute($result);
?>