PHP 5 MySQLi Functions
Introduction to PHP MySQLi
PHP MySQLi = PHP MySQL Improved!
MySQLi functions allow you to access the MySQL database server.
Note: The MySQLi extension is designed to work with MySQL version 4.1.13 or newer.
Installation/Runtime Configuration
In order to be able to use MySQLi functions smoothly, you must add support for the MySQLi extension 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 installation details, please visit: http://www.php.net/manual/en/mysqli.installation.php
For run configuration details, please visit: http://www.php. net/manual/en/mysqli.configuration.php
PHP 5 MySQLi function
Function
Description
mysqli_affected_rows() Returns the number of record rows affected by the previous MySQL operation.
mysqli_autocommit() Turn on or off automatic submission of database modifications.
mysqli_change_user() Change the user of the specified database connection.
mysqli_character_set_name() Returns the default character set of the database connection.
mysqli_close() Close the previously opened database connection.
mysqli_commit() Submit 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() Open a new connection to the MySQL server.
mysqli_data_seek() Adjust the result pointer to an arbitrary row in the result set.
mysqli_debug() Perform debugging operations.
mysqli_dump_debug_info() Dump debugging information into the log.
mysqli_errno() Returns the last error code of the most recently called function.
mysqli_error_list() Returns the error list of the most recently called function.
mysqli_error() Returns the last error description of the most recently called function.
mysqli_fetch_all() Gets all rows from the result set as an associative array, a numeric array, or both.
mysqli_fetch_array() Gets a row from the result set as an associative array, a numeric array, or both.
mysqli_fetch_assoc() Gets a row from the result set as an associative array.
mysqli_fetch_field_direct() Gets the meta-data of a single field from the result set and returns it as an object.
mysqli_fetch_field() Gets the next field from the result set and returns it as an object.
mysqli_fetch_fields() Returns an array of objects representing fields in the result.
mysqli_fetch_lengths() Returns the length of each column of the current row in the result set.
mysqli_fetch_object() Gets the current row from the result set and returns it as an object.
mysqli_fetch_row() Gets a row from the result set and returns it as an enumeration array.
mysqli_field_count() Returns the number of columns recently queried.
mysqli_field_seek() Sets the pointer in the result set to the offset of the specified field.
mysqli_field_tell() Returns the position of the pointer in the result set.
mysqli_free_result() Releases the result memory.
mysqli_get_charset() Returns the character set object.
mysqli_get_client_info() Returns the MySQL client library version.
mysqli_get_client_stats() Returns statistics about each process of the client.
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 host name 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 the resources used by mysqli_real_connect().
mysqli_insert_id() Returns the automatically 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() Execute 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() Set additional connection options to affect connection behavior.
mysqli_ping() Makes a server connection and tries to reconnect if the connection is disconnected.
mysqli_prepare() Prepare to execute a SQL statement.
mysqli_query() Execute a query against the database.
mysqli_real_connect() Opens a new link to the MySQL server.
mysqli_real_escape_string() Escape special characters in strings used in SQL statements.
mysqli_real_query() Execute SQL query
mysqli_reap_async_query() Return the results of asynchronous query.
mysqli_refresh() Refresh the table or cache, or reset the replication server information.
mysqli_rollback() Rollback the current transaction in the database.
mysqli_select_db() Change the default database for connection.
mysqli_set_charset() Set the default client character set.
mysqli_set_local_infile_default() Undoes the user-defined handle used for the load local infile command.
mysqli_set_local_infile_handler() Sets the rollback function for the LOAD DATA LOCAL INFILE command.
mysqli_sqlstate() Returns the SQLSTATE error code of the last MySQL operation.
mysqli_ssl_set() is used to create an SSL secure connection.
mysqli_stat() Returns the current system status.
mysqli_stmt_init() Initializes the statement and returns the object used by mysqli_stmt_prepare().
mysqli_store_result() Transfers the result set of the last query.
mysqli_thread_id() Returns the thread ID of the current connection.
mysqli_thread_safe() Returns whether the client library is compiled into thread-safe.
mysqli_use_result() Initializes the retrieval of the result set from the last query executed using mysqli_real_query().
mysqli_warning_count() Returns the number of warnings for the last query in the connection.
The above is the content of [php tutorial] PHP 5 MySQLi functions. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!