sqlsrv_get_field

sqlsrv_get_field - Gets field data from the currently selected row
Manual
Code Examples

sqlsrv_get_field( resource$stmt, int$fieldIndex, [int$getAsType] ): mixed

Gets field data from the currently selected row. Fields must be accessed in order. Field indices start at 0.

Parameters

stmt

A statement resource returned by sqlsrv_query or sqlsrv_execute.

fieldIndex

The index of the field to be retrieved. Field indices start at 0. Fields must be accessed in order. i.e. If you access field index 1, then field index 0 will not be available.

getAsType

The PHP data type for the returned field data. If this parameter is not set, the field data will be returned as its default PHP data type. For information about default PHP data types, see Default PHP Data Types in the Microsoft SQLSRV documentation.

Return Values

Returns data from the specified field on success. Returns false otherwise.

Related Functions

Example of sqlsrv_get_field

Show all examples for sqlsrv_get_field

PHP Version: