sqlsrv_fetch

sqlsrv_fetch - Makes the next row in a result set available for reading
Manual
Code Examples

sqlsrv_fetch( resource$stmt, [int$row], [int$offset] ): mixed

Makes the next row in a result set available for reading. Use sqlsrv_get_field to read the fields of the row.

Parameters

stmt

A statement resource created by executing sqlsrv_query or sqlsrv_execute.

row

The row to be accessed. This parameter can only be used if the specified statement was prepared with a scrollable cursor. In that case, this parameter can take on one of the following values: SQLSRV_SCROLL_NEXT SQLSRV_SCROLL_PRIOR SQLSRV_SCROLL_FIRST SQLSRV_SCROLL_LAST SQLSRV_SCROLL_ABSOLUTE SQLSRV_SCROLL_RELATIVE

offset

Specifies the row to be accessed if the row parameter is set to SQLSRV_SCROLL_ABSOLUTE or SQLSRV_SCROLL_RELATIVE. Note that the first row in a result set has index 0.

Return Values

Returns true if the next row of a result set was successfully retrieved, false if an error occurs, and null if there are no more rows in the result set.

Related Functions

Example of sqlsrv_fetch

Show all examples for sqlsrv_fetch

PHP Version: