| title | SQLSRV Driver API Reference | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 01/19/2017 | |
| ms.prod | sql-non-specified | |
| ms.prod_service | drivers | |
| ms.service | ||
| ms.component | php | |
| ms.reviewer | ||
| ms.suite | sql | |
| ms.technology |
|
|
| ms.tgt_pltfrm | ||
| ms.topic | article | |
| ms.assetid | 0b55da26-ddeb-4e89-872a-91e0aba57103 | |
| caps.latest.revision | 42 | |
| author | MightyPen | |
| ms.author | genemi | |
| manager | jhubbard | |
| ms.workload | On Demand |
[!INCLUDEDriver_PHP_Download]
The API name for the SQLSRV driver in the [!INCLUDEssDriverPHP] 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:
| Function | Description |
|---|---|
| sqlsrv_begin_transaction | Begins a transaction. |
| sqlsrv_cancel | Cancels a statement; discards any pending results for the statement. |
| sqlsrv_client_info | Provides information about the client. |
| sqlsrv_close | Closes a connection. Frees all resources associated with the connection. |
| sqlsrv_commit | Commits a transaction. |
| sqlsrv_configure | Changes error handling and logging configurations. |
| sqlsrv_connect | Creates and opens a connection. |
| sqlsrv_errors | Returns error and/or warning information about the last operation. |
| sqlsrv_execute | Executes a prepared statement. |
| sqlsrv_fetch | Makes the next row of data available for reading. |
| sqlsrv_fetch_array | Retrieves the next row of data as a numerically indexed array, an associative array, or both. |
| sqlsrv_fetch_object | Retrieves the next row of data as an object. |
| sqlsrv_field_metadata | Returns field metadata. |
| sqlsrv_free_stmt | Closes a statement. Frees all resources associated with the statement. |
| sqlsrv_get_config | Returns the value of the specified configuration setting. |
| sqlsrv_get_field | Retrieves a field in the current row by index. The PHP return type can be specified. |
| sqlsrv_has_rows | Detects if a result set has one or more rows. |
| sqlsrv_next_result | Makes the next result available for processing. |
| sqlsrv_num_rows | Reports the number of rows in a result set. |
| sqlsrv_num_fields | Retrieves the number of fields in an active result set. |
| sqlsrv_prepare | Prepares a Transact-SQL query without executing it. Implicitly binds parameters. |
| sqlsrv_query | Prepares and executes a Transact-SQL query. |
| sqlsrv_rollback | Rolls back a transaction. |
| sqlsrv_rows_affected | Returns the number of modified rows. |
| sqlsrv_send_stream_data | Sends up to eight kilobytes (8 KB) of data to the server with each call to the function. |
| sqlsrv_server_info | Provides information about the server. |
Overview of the PHP SQL Driver
Constants (Microsoft Drivers for PHP for SQL Server)
Programming Guide for PHP SQL Driver
Getting Started with the PHP SQL Driver