Php Ref Mysqli
* * *
## PHP MySQLi Introduction
**PHP MySQLi = PHP MySQL Improved!**
MySQLi functions allow you to access MySQL database server.
**Note:** The MySQLi extension is designed to work with MySQL version 4.1.13 or newer.
* * *
## Installation / Runtime Configuration
To successfully use MySQLi functions, you must add MySQLi extension support when compiling PHP.
The MySQLi extension was introduced in PHP version 5.0.0. MySQL Native Driver is included in PHP version 5.3.0.
For detailed installation information, please visit: [http://www.php.net/manual/en/mysqli.installation.php](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](http://www.php.net/manual/en/mysqli.configuration.php)
* * *
## PHP 5 MySQLi Functions
| Function | Description |
| --- | --- |
| [mysqli_affected_rows()]( | Returns the number of affected rows in the previous MySQL operation. |
| [mysqli_autocommit()]( | Turns on or off auto-committing database modifications. |
| [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 from the last connection error. |
| [mysqli_connect_error()]( | Returns the error description from the last connection error. |
| [mysqli_connect()]( | Opens a new connection to a MySQL server. |
| [mysqli_data_seek()]( | Adjusts the result pointer to an arbitrary row in the result set. |
| [mysqli_debug()]( | Performs debug operations. |
| [mysqli_dump_debug_info()]( | Dumps debug information into the log. |
| [mysqli_errno()]( | Returns the last error code from the most recent function call. |
| [mysqli_error_list()]( | Returns a list of errors from the most recent function call. |
| [mysqli_error()]( | Returns the last error description from the most recent function call. |
| [mysqli_fetch_all()]( | Fetches all rows from a result set as an associative array, a numeric array, or both. |
| [mysqli_fetch_array()]( | Fetches a row from a result set as an associative array, a numeric array, or both. |
| [mysqli_fetch_assoc()]( | Fetches a row from a result set as an associative array. |
| [mysqli_fetch_field_direct()]( | Gets meta-data for a single field from a result set and returns it as an object. |
| [mysqli_fetch_field()]( | Gets the next field from a result set and returns it as an object. |
| [mysqli_fetch_fields()]( | Returns an array of objects representing the fields in a result set. |
| [mysqli_fetch_lengths()]( | Returns the lengths of the columns of the current row in a result set. |
| [mysqli_fetch_object()]( | Fetches the current row from a result set and returns it as an object. |
| [mysqli_fetch_row()]( | Fetches a row from a result set and returns it as an enumerated array. |
| [mysqli_field_count()]( | Returns the number of columns for the most recent query. |
| [mysqli_field_seek()]( | Sets the result set pointer to the specified field offset. |
| [mysqli_field_tell()]( | Returns the position of the field cursor in the result set. |
| [mysqli_free_result()]( | Frees the result memory. |
| [mysqli_get_charset()]( | Returns the charset object. |
| [mysqli_get_client_info()]( | Returns the MySQL client library version. |
| [mysqli_get_client_stats()]( | Returns statistics per process about the client. |
| [mysqli_get_client_version()]( | Returns the MySQL client library version as an integer. |
| [mysqli_get_connection_stats()]( | Returns statistics about the client connection. |
| [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 ID generated in the last query. |
| [mysql_kill()]( | Asks the server to kill a MySQL thread. |
| [mysqli_more_results()]( | Checks if there are any more query results from a multi query. |
| [mysqli_multi_query()]( | Executes one or more queries against the database. |
| [mysqli_next_result()]( | Prepares the next result set from mysqli_multi_query(). |
| [mysqli_num_fields()]( | Returns the number of fields in a result set. |
| [mysqli_num_rows()]( | Returns the number of rows in a result set. |
| [mysqli_options()]( | Sets extra connect options to affect the connection behavior. |
| [mysqli_ping()]( | Pings a server connection, or tries to reconnect if the connection has gone down. |
| mysqli_prepare() | Prepares an SQL statement for execution. |
| [mysqli_query()]( | Executes a query against the database. |
| [mysqli_real_connect()]( | Opens a new connection to a MySQL server. |
| [mysqli_real_escape_string()]( | Escapes special characters in a string for use in an SQL statement. |
| [mysqli_real_query()]( | Executes an SQL query. |
| [mysqli_refresh()]( | Refreshes tables or caches, or resets the replication server information. |
| [mysqli_rollback()]( | Rolls back the current transaction for 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()]( | Unsets the user-defined handler for the LOAD_LOCAL_INFILE command. |
| [mysqli_set_local_infile_handler()]( | Sets a callback function for the LOAD_LOCAL_INFILE command. |
| [mysqli_sqlstate()]( | Returns the SQLSTATE error code from the last MySQL operation. |
| [mysqli_ssl_set()]( | Used to establish secure connections using SSL. |
| [mysqli_stat()]( | Returns the current system status of the server. |
| [mysqli_stmt_affected_rows()]( | Returns the number of rows affected by the last statement execution. |
| [mysqli_stmt_attr_get()]( | Gets the value of an attribute for a prepared statement. |
| [mysqli_stmt_attr_set()]( | Sets the value of an attribute for a prepared statement. |
| [mysqli_stmt_bind_param()]( | Binds variables to a prepared statement as parameters. |
| [mysqli_stmt_bind_result()]( | Binds variables to a prepared statement to store results. |
| [mysqli_stmt_close()]( | Closes a prepared statement. |
| [mysqli_stmt_data_seek()]( | Seeks to an arbitrary row in a statement result set. |
| [mysqli_stmt_errno()]( | Returns the error code for the last statement call. |
| [mysqli_stmt_error()]( | Returns the error description for the last statement call. |
| [mysqli_stmt_execute()]( | Executes a prepared statement. |
| [mysqli_stmt_fetch()]( | Fetches results from a prepared statement into bound variables. |
| [mysqli_stmt_field_count()]( | Returns the number of columns in a statement result set. |
| [mysqli_stmt_free_result()]( | Frees the result memory of a prepared statement. |
| [mysqli_stmt_get_result()]( | Gets a result set from a prepared statement. |
| [mysqli_stmt_get_warnings()]( | Gets the warning count from the last statement execution. |
| [mysqli_stmt_init()]( | Initializes a statement and returns an object for use with mysqli_stmt_prepare(). |
| [mysqli_stmt_insert_id()]( | Returns the ID generated by a prepared statement in the last query. |
| [mysqli_stmt_more_results()]( | Checks if there are more results from a multi statement. |
| [mysqli_stmt_next_result()]( | Gets the next result from a multi statement execution. |
| [mysqli_stmt_num_rows()]( | Returns the number of rows in the result set of a prepared statement. |
| [mysqli_stmt_param_count()]( | Returns the number of parameters in a prepared statement. |
| [mysqli_stmt_prepare()]( | Prepares an SQL statement for execution. |
| [mysqli_stmt_reset()]( | Resets a prepared statement. |
| [mysqli_stmt_result_metadata()]( | Returns result metadata from a prepared statement. |
| [mysqli_stmt_send_long_data()]( | Sends long data in chunks to the server. |
| [mysqli_stmt_sqlstate()]( | Returns the SQLSTATE code from the last statement operation. |
| [mysqli_stmt_store_result()]( | Transfers a result set from a prepared statement. |
| [mysqli_store_result()]( | Transfers a result set from the last query. |
| [mysqli_thread_id()]( | Returns the thread ID of the current connection. |
| [mysqli_thread_safe()]( | Returns whether the client library is compiled as thread-safe. |
| [mysqli_use_result()]( | Initiates the retrieval of a result set from the last query executed using mysqli_real_query(). |
| [mysqli_warning_count()]( | Returns the number of warnings from the last query in the connection. |
YouTip