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 参考

 

sasql_stmt_insert_id

原型
int sasql_stmt_insert_id( sasql_stmt $stmt )
说明

返回最后插入到 IDENTITY 列或 DEFAULT AUTOINCREMENT 列中的值,如果是最后插入到了不含 IDENTITY 或 DEFAULT AUTOINCREMENT 列的表中,则返回零。

参数

$stmt   由 sasql_stmt_execute 执行的语句资源。

返回值

由前一个 INSERT 语句为 IDENTITY 列或 DEFAULT AUTOINCREMENT 列生成的 ID 或者零(如果最后的插入不影响 IDENTITY 或 DEFAULT AUTOINCREMENT 列)。如果 $stmt 无效,此函数可返回 FALSE (0)。

相关函数