Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere PHP API » SQL Anywhere PHP API reference

sqlanywhere_rollback Next Page



bool sqlanywhere_set_option( resource link_identifier, string option, string value )


Sets the value of the specified option on the specified connection. You can set the value for the following options:

auto_commitWhen this option is set to on, the database server commits after executing each statement. on
row_countsWhen this option is set to false, the sqlanywhere_num_rows function returns an estimate of the number of rows affected. If you want to obtain an exact count, set this option to true.false
verbose_errorsWhen this option is set to true, the PHP driver returns verbose errors. When this option is set to false, you must call the sqlanywhere_error or sqlanywhere_errorcode functions to get further error information.true

You can change the default value for an option by including the following line in the php.ini file. In this example, the default value is set for the auto_commit option.


link_identifier    The link identifier returned by a sqlanywhere_connect function.

option    The name of the option you want to set.

value    The new option value.


True on success or false on failure.


The following examples show the different ways you can set the value of the auto_commit option.

$result = sqlanywhere_set_option( $conn, "auto_commit", "Off" );
$result = sqlanywhere_set_option( $conn, "auto_commit", 0 );
$result = sqlanywhere_set_option( $conn, "auto_commit", False );
Related functions