odbc_setoption — Sets certain ODBC options.
int odbc_setoption(id, function, option, parameter);
resource id: Connection or
int function: Function to
int option: Option to
int parameter: Option
TRUE on success; FALSE on error
This is a specialist function and should be used with
care unless you know your way around ODBC. Unlike other
ODBC functions, this works with either the connection ID
or the result ID, depending on your situation. In
addition, this function can be driver-specific, and some
options may not work inside or outside a connection or
result. In short, be careful.
The value of the function
parameter is set to 1, meaning SQLSetConnectOption() if id is a connection ID, or 2, meaning SQLSetStmtOption() if id is a result ID.
Existing since version 3.0.6
Example 1360. Set autocommit
$db = odbc_connect("DSN","user","pass");
odbc_setoption($db, 1, 102, 1);
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.