PHP 5 MySQLiFunctions
PHP MySQLi Introduction
PHP MySQLi = PHP MySQL Improved!
The MySQLi functions allow you to access the MySQL database server.
Note:The MySQLi extension is designed for MySQL version 4.1.13 or newer.
Installation / Runtime Configuration
To use the MySQLi functions smoothly, you must add support for the MySQLi extension when compiling PHP.
The MySQLi extension was introduced in PHP 5.0.0. The MySQL Native Driver is included in PHP 5.3.0.
For detailed installation information, please visit:http://www.php.net/manual/en/mysqli.installation.php
For detailed runtime configuration information, please visit:http://www.php.net/manual/en/mysqli.configuration.php
PHP 5 MySQLi Functions
| Function | Description |
|---|---|
| mysqli_affected_rows() | Returns the number of rows affected by the previous MySQL operation. |
| mysqli_autocommit() | Turns auto-commit of database modifications on or off. |
| mysqli_change_user() | Changes the user of the specified database connection. |
| mysqli_character_set_name() | Returns the default character set of the database connection. |
| mysqli_close() | Closes a previously opened database connection. |
| mysqli_commit() | Commits the current transaction. |
| mysqli_connect_errno() | Returns the error code of the last connection error. |
| mysqli_connect_error() | Returns the error description of the last connection error. |
| mysqli_connect() | Opens a new connection to the MySQL server. |
| mysqli_data_seek() | Adjusts the result pointer to an arbitrary row in the result set. |
| mysqli_debug() | Performs debugging operations. |
| mysqli_dump_debug_info() | Dumps debugging information into the log. |
| mysqli_errno() | Returns the error code of the most recently called function. |
| mysqli_error_list() | Returns a list of errors from the most recently called function. |
| mysqli_error() | Returns the error description of the most recently called function. |
| mysqli_fetch_all() | Fetches all rows from the result set as an associative array, a numeric array, or both. |
| mysqli_fetch_array() | Fetches a row from the result set as an associative array, a numeric array, or both. |
| mysqli_fetch_assoc() | Fetches a row from the result set as an associative array. |
| mysqli_fetch_field_direct() | Fetches meta-data for a single field from the result set and returns it as an object. |
| mysqli_fetch_field() | Fetches the next field from the result set and returns it as an object. |
| mysqli_fetch_fields() | Returns an array of objects representing the fields in the result. |
| mysqli_fetch_lengths() | Returns the length of each column of the current row in the result set. |
| mysqli_fetch_object() | Fetches the current row from the result set and returns it as an object. |
| mysqli_fetch_row() | Fetches a row from the result set and returns it as an enumerated array. |
| mysqli_field_count() | Returns the number of columns in the most recent query. |
| mysqli_field_seek() | Sets the pointer in the result set to a specified field offset. |
| mysqli_field_tell() | Returns the position of the pointer in the result set. |
| mysqli_free_result() | Frees the result memory. |
| mysqli_get_charset() | Returns a character set object. |
| mysqli_get_client_info() | Returns the MySQL client library version. |
| mysqli_get_client_stats() | Returns statistics about each client process. |
| mysqli_get_client_version() | Returns the MySQL client library version as an integer. |
| mysqli_get_connection_stats() | Returns statistics about client connections. |
| mysqli_get_host_info() | Returns the MySQL server hostname and connection type. |
| mysqli_get_proto_info() | Returns the MySQL protocol version. |
| mysqli_get_server_info() | Returns the MySQL server version. |
| mysqli_get_server_version() | Returns the MySQL server version as an integer. |
| mysqli_info() | Returns information about the most recently executed query. |
| mysqli_init() | Initializes MySQLi and returns a resource for use with mysqli_real_connect(). |
| mysqli_insert_id() | Returns the auto-generated ID from the last query. |
| mysql_kill() | Requests the server to kill a MySQL thread. |
| mysqli_more_results() | Checks whether a multi-query has more results. |
| mysqli_multi_query() | Executes one or more queries against the database. |
| mysqli_next_result() | Prepares the next result set for mysqli_multi_query(). |
| mysqli_num_fields() | Returns the number of fields in the result set. |
| mysqli_num_rows() | Returns the number of rows in the result set. |
| mysqli_options() | Sets extra connection options to affect connection behavior. |
| mysqli_ping() | Opens a connection to the server, and attempts to reconnect if the connection is broken. |
| mysqli_prepare() | Prepares an SQL statement for execution. |
| mysqli_query() | Performs a query against the database. |
| mysqli_real_connect() | Opens a new connection to the MySQL server. |
| mysqli_real_escape_string() | Escapes special characters in a string for use in an SQL statement. |
| mysqli_real_query() | Performs an SQL query. |
| mysqli_reap_async_query() | Returns the result of an asynchronous query. |
| mysqli_refresh() | Flushes tables or caches, or resets replication server information. |
| mysqli_rollback() | Rolls back the current transaction in the database. |
| mysqli_select_db() | Changes the default database for the connection. |
| mysqli_set_charset() | Sets the default client character set. |
| mysqli_set_local_infile_default() | Revokes a user-defined handle used for the LOAD LOCAL INFILE command. |
| mysqli_set_local_infile_handler() | Sets the callback function for the LOAD DATA LOCAL INFILE command. |
| mysqli_sqlstate() | Returns the SQLSTATE error code of the last MySQL operation. |
| mysqli_ssl_set() | Used to create a secure SSL connection. |
| mysqli_stat() | Returns the current system status. |
| mysqli_stmt_init() | Initializes a statement and returns an object for use with mysqli_stmt_prepare(). |
| mysqli_store_result() | Returns the current result set. |
| mysqli_thread_id() | Returns the thread ID of the current connection. |
| mysqli_thread_safe() | Returns whether the client library has been compiled as thread-safe. |
| mysqli_use_result() | Initializes a result set retrieval from the last query executed using mysqli_real_query(). |
| mysqli_warning_count() | Returns the number of warnings from the last query on the connection. |