[Php Tutorial] PHP5MySQLi function

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming...

PHP 5 MySQLi function

Introduction to PHP MySQLi

PHP MySQLi = PHP MySQL Improved!

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

Note: The MySQLi extension is designed for MySQL 4.1.13 or later.

Install/Runtime configuration

To smoothly use the MySQLi function, you must add support for MySQLi extension when compiling PHP.

MySQLi extensions are introduced in PHP 5.0.0. MySQL Native Driver is included in PHP 5.3.0.

For installation details, 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

Description

Mysqli_affected_rows () returns the number of records affected by the previous MySQL operation.

Mysqli_autocommit () enables or disables automatic submission of database modifications.

Mysqli_change_user () changes the user of the specified database connection.

Mysqli_character_set_name () returns the default character set for database connection.

Mysqli_close () closes the 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 any row in the result set.

Mysqli_debug () for debugging.

Mysqli_dump_debug_info () dumps debugging information to the log.

Mysqli_errno () returns the last error code of the recently called function.

Mysqli_error_list () returns the list of recent function call errors.

Mysqli_error () returns the last error description of the recently called function.

Mysqli_fetch_all () retrieves all rows from the result set as an associated array, or an array of numbers, or both.

Mysqli_fetch_array () retrieves a row from the result set as an associated array, or an array of numbers, or both.

Mysqli_fetch_assoc () retrieves a row from the result set as the associated array.

Mysqli_fetch_field_direct () obtains the meta-data of a single field from the result set and returns it as an object.

Mysqli_fetch_field () retrieves the next field from the result set and returns it as an object.

The array of objects that represent fields in the returned results of mysqli_fetch_fields.

Mysqli_fetch_lengths () returns the length of each column in the current row in the result set.

Mysqli_fetch_object () retrieves the current row from the result set and returns the row as an object.

Mysqli_fetch_row () retrieves a row from the result set and returns it as an enumerated array.

Mysqli_field_count () returns the number of recently queried columns.

Mysqli_field_seek () sets the pointer in the result set to the offset of the specified field.

The position of the pointer in the result set returned by mysqli_field_tell.

Mysqli_free_result () releases the result memory.

Mysqli_get_charset () returns the character set object.

Mysqli_get_client_info () returns the MySQL client version.

Mysqli_get_client_stats () returns statistics about each process on the client.

Mysqli_get_client_version () returns the MySQL client database 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 latest query execution.

Mysqli_init () initializes MySQLi and returns the resources used by mysqli_real_connect.

Mysqli_insert_id () returns the ID automatically generated in 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 for the database.

Mysqli_next_result () prepares the next result set for mysqli_multi_query.

The number of fields in the returned result set by mysqli_num_fields.

Mysqli_num_rows () returns the number of rows in the result set.

Set additional connection options for mysqli_options () to affect connection behavior.

Mysqli_ping () for a server connection. if the connection is disconnected, try again.

Mysqli_prepare () is prepared to execute an SQL statement.

Mysqli_query () executes a database query.

Mysqli_real_connect () opens a new link to the MySQL server.

Special characters in the string used by mysqli_real_escape_string () escape in the SQL statement.

Mysqli_real_query () executes an SQL query

Mysqli_reap_async_query () returns the result of an asynchronous query.

Mysqli_refresh () refreshes the table or cache, or resets the copy server information.

Mysqli_rollback () rolls back the current transaction in the database.

Mysqli_select_db () changes the default database to be connected.

Mysqli_set_charset () sets the default client character set.

Mysqli_set_local_infile_default () undo 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 declaration and returns the object used by mysqli_stmt_prepare.

Mysqli_store_result () transmits the result set of the last query.

Mysqli_thread_id () returns the ID of the thread of the current connection.

Mysqli_thread_safe () returns whether to compile the client library into thread-safe.

Mysqli_use_result () initializes the retrieval of the result set from the query that was last 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 the php 5 MySQLi function in [PHP Tutorial]. For more information, see PHP Chinese network (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.