Export (0) Print
Expand All

SQLSRV Driver API Reference


DownloadDownload PHP Driver

The API name for the SQLSRV driver in the Microsoft Drivers for PHP for SQL Server is sqlsrv. All sqlsrv functions begin with sqlsrv_ and are followed by a verb or a noun. Those followed by a verb perform some action and those followed by a noun return some form of metadata.

The SQLSRV driver contains the following functions:

sqlsrv_begin_transactionBegins a transaction.
sqlsrv_cancelCancels a statement; discards any pending results for the statement.
sqlsrv_client_infoProvides information about the client.
sqlsrv_closeCloses a connection. Frees all resources associated with the connection.
sqlsrv_commitCommits a transaction.
sqlsrv_configureChanges error handling and logging configurations.
sqlsrv_connectCreates and opens a connection.
sqlsrv_errorsReturns error and/or warning information about the last operation.
sqlsrv_executeExecutes a prepared statement.
sqlsrv_fetchMakes the next row of data available for reading.
sqlsrv_fetch_arrayRetrieves the next row of data as a numerically indexed array, an associative array, or both.
sqlsrv_fetch_objectRetrieves the next row of data as an object.
sqlsrv_field_metadataReturns field metadata.
sqlsrv_free_stmtCloses a statement. Frees all resources associated with the statement.
sqlsrv_get_configReturns the value of the specified configuration setting.
sqlsrv_get_fieldRetrieves a field in the current row by index. The PHP return type can be specified.
sqlsrv_has_rowsDetects if a result set has one or more rows.
sqlsrv_next_resultMakes the next result available for processing.
sqlsrv_num_rowsReports the number of rows in a result set.
sqlsrv_num_fieldsRetrieves the number of fields in an active result set.
sqlsrv_preparePrepares a Transact-SQL query without executing it. Implicitly binds parameters.
sqlsrv_queryPrepares and executes a Transact-SQL query.
sqlsrv_rollbackRolls back a transaction.
sqlsrv_rows_affectedReturns the number of modified rows.
sqlsrv_send_stream_dataSends up to eight kilobytes (8 KB) of data to the server with each call to the function.
sqlsrv_server_infoProvides information about the server.

PHP Manual

Overview of the PHP SQL DriverConstants (Microsoft Drivers for PHP for SQL Server)
Programming Guide for PHP SQL DriverGetting Started with the PHP SQL Driver

Community Additions

© 2016 Microsoft