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

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere PHP API » SQL Anywhere PHP API 参考 » 不建议使用 PHP 函数

 

sqlanywhere_set_option(不建议使用)

原型
bool sqlanywhere_set_option(  resource link_identifier, string option, mixed value )
说明

不建议使用此函数。应该改用以下 PHP 函数: sasql_set_option.

在指定连接上设置指定选项的值。可以为以下选项设置值:

名称 说明 缺省值
auto_commit 此选项设置为 on 时,数据库服务器在每执行一条语句后提交。 on
row_counts 此选项设置为 FALSE 时,sqlanywhere_num_rows 函数返回受影响的行数估计值。如果想获得准确计数,请将此选项设置为 TRUE。 FALSE
verbose_errors 此选项设置为 TRUE 时,PHP 驱动程序返回详细的错误信息。此选项设置为 FALSE 时,必须调用 sqlanywhere_error 或 sqlanywhere_errorcode 函数以获取更详细的错误信息。 TRUE

可以通过在 php.ini 文件中加入以下行,更改选项的缺省值。在本示例中,为 auto_commit 选项设置了缺省值。

sqlanywhere.auto_commit=0
参数

link_identifier   由 sqlanywhere_connect 函数返回的链接标识符。

option   要设置的选项的名称。

value   新的选项值。

返回值

TRUE(成功时)或 FALSE(失败时)。

示例

以下示例说明设置 auto_commit 选项值的不同方法。

$result = sqlanywhere_set_option( $conn, "auto_commit", "Off" );
$result = sqlanywhere_set_option( $conn, "auto_commit", 0 );
$result = sqlanywhere_set_option( $conn, "auto_commit", False );
相关函数