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_fetch_object(不建议使用)

原型
object sqlanywhere_fetch_object(  resource result_identifier  )
说明

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

从结果集读取一行。该行作为一个仅可按列名进行索引的对象返回。

参数

result_identifier   由 sqlanywhere_query 函数返回的结果资源。

返回值

代表结果集中的行的对象或 FALSE(行不可用时)。

示例

本示例说明如何从结果集中一次检索一行作为一个对象。列名可用作对象成员以访问列值。

$result = sqlanywhere_query( $conn, "SELECT GivenName, Surname FROM Employees" );
  While( ($row = sqlanywhere_fetch_object( $result )) ) {
        echo "$row->GivenName \n";   # output the data in the first column only.
  }
相关函数