Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

PHP 5 MySQLi function


May 11, 2021 PHP


Table of contents


PHP 5 MySQLi function

The important thing to note when using mySQLi functions in PHP is that you need to add support for MySQLi extensions.


Introduction to PHP MySQLi

PHP MySQLi = PHP MySQL Improved!

The MySQLi function allows you to access the MySQL database server.

Note: MySQLi extensions are designed for MySQL version 4.1.13 or later.


Install / Runtime configuration

In order to be able to use the MySQLi function smoothly, you must add support for mySQLi extensions when compiling PHP.

The MySQLi extension was introduced in PHP 5.0.0. MySQL Native Driver is included in PHP 5.3.0.

For more information about the installation, visit: http://www.php.net/manual/en/mysqli.installation.php

For more information about running configurations, visit: http://www.php.net/manual/en/mysqli.configuration.php


PHP 5 MySQLi function

function describe
mysqli_affected_rows() Returns the number of records that affect the previous mysql operation.
mysqli_autocommit() Open or close Auto Submit Database Modifications.
mysqli_change_user() Change the user who specifies the database connection.
mysqli_character_set_name() Returns the default character set for the database connection.
mysqli_close() Close the previously opened database connection.
mysqli_commit() Submit the current transaction.
mysqli_connect_errno() Returns the error code for the last connection error.
mysqli_connect_error() Returns an error description of the last connection error.
mysqli_connect() Open a new connection to the MySQL server.
mysqli_data_seek() Adjust results pointer to an arbitrary line of the result set.
mysqli_debug() Perform debugging operations.
mysqli_dump_debug_info() Dump debug information to the log.
mysqli_errno() Returns the last error code that has recently called the function.
mysqli_error_list() Returns an error list that has recently called functions.
mysqli_error() Returns the last error description of the recent call function.
mysqli_fetch_all() All lines are obtained from the result set as an associated array, or a numeric array, or both.
mysqli_fetch_array() A line is obtained from the result set as an associated array, or a numeric array, or both.
mysqli_fetch_assoc() A line is obtained from the result set as an associated array.
mysqli_fetch_field_direct() The meta-data of a single field is obtained from the result set, and is returned as an object.
mysqli_fetch_field() The next field is obtained from the result set and returned as an object.
mysqli_fetch_fields() Returns an array of objects representing the fields of the field.
mysqli_fetch_lengths() Returns the length of each column of the current line in the result.
mysqli_fetch_object() The current line is obtained from the result set and returned as an object.
mysqli_fetch_row() The row is obtained from the result set and returned as an enumeration array.
mysqli_field_count() Returns the number of columns recently queried.
mysqli_field_seek() Set the pointer in the result set to the offset of the specified field.
mysqli_field_tell() Returns the location of the pointer in the result set.
mysqli_free_result() Release the result memory.
mysqli_get_charset() Returns the character set object.
mysqli_get_client_info() Return to the MySQL client library version.
mysqli_get_client_stats() Returns the statistics on each process of the client.
mysqli_get_client_version() Return the MySQL client library version to an integer.
mysqli_get_connection_stats() Returns the statistics on the client connection.
mysqli_get_host_info() Returns the MySQL server hostname and connection type.
mysqli_get_proto_info() Return to the MySQL protocol version.
mysqli_get_server_info() Returns the MySQL server version.
mysqli_get_server_version() Return the MySQL server version as an integer.
mysqli_info() Returns information about recently executing queries.
mysqli_init() Initialize MySQLI and return the resources used by mysqli_real_connect ().
mysqli_insert_id() Returns the automatically generated ID in the last query.
mysql_kill() Request the server to kill a MySQL thread.
mysqli_more_results() Check if a multi-query has more results.
mysqli_multi_query() Perform one or more queries for the database.
mysqli_next_result() Prepare the next result set for mysqli_multi_query ().
mysqli_num_fields() Returns the number of results centralized fields.
mysqli_num_rows() Returns the quantity of the resulting line.
mysqli_options() Set additional connection options to affect connection behavior.
mysqli_ping() Perform a server connection, if the connection is disconnected, try reconnect.
mysqli_prepare() Prepare an SQL statement.
mysqli_query() Perform a query for a database.
mysqli_real_connect() Open a new link to the MySQL server.
mysqli_real_escape_string() Essence special characters in the string used in the SQL statement.
mysqli_real_query() Execute SQL query
mysqli_reap_async_query() Returns the result of the asynchronous query.
mysqli_refresh() Refresh the table or cache, or reset the copy server information.
mysqli_rollback() Roll back the current transaction in the database.
mysqli_select_db() Change the default database for the connection.
mysqli_set_charset() Set the default client character set.
mysqli_set_local_infile_default() Undo user-defined handle for the LOAD LOCAL INFILE command.
mysqli_set_local_infile_handler() Set the rollback function for the Load Data local infile command.
mysqli_sqlstate() Returns the last MySQL operation of the SQLState error code.
mysqli_ssl_set() Used to create an SSL secure connection.
mysqli_stat() Returns the current system status.
mysqli_stmt_init() Initialization declaration and returns objects used by mysqli_stmt_prepare ().
mysqli_store_result() Transmits the result set of the last query.
mysqli_thread_id() Returns the currently connected thread ID.
mysqli_thread_safe() Returns whether to compile the client library into thread-safe.
mysqli_use_result() From the last query executed in the query executed in the query executed, the retrieval of the result set is initialized.
mysqli_warning_count() Returns the number of warns for the last query in the connection.

That's all about the MySQLi function!