PHP Tutorial PHP 5 mysqli function

Source: Internet
Author: User
Tags php mysql php tutorial

PHP 5 mysqli functions

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 version 4.1.13 or later.

Installation/Runtime Configuration

In order to successfully use the MYSQLI function, you must add support for the mysqli extension when compiling PHP.

The mysqli extension was introduced in the PHP 5.0.0 release. MySQL Native Driver is included in the PHP 5.3.0 version.

For more information on 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 functions

Function

Describe

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

Mysqli_autocommit () Turns automatic commit database modification on or off.

Mysqli_change_user () Changes the user who specified the database connection.

Mysqli_character_set_name () returns the default character set for the 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 for 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 a debug operation.

Mysqli_dump_debug_info () Dumps debug information into the log.

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

Mysqli_error_list () returns the list of errors for the most recently called function.

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

Mysqli_fetch_all () takes all rows from the result set as associative arrays, or arrays of numbers, or both.

Mysqli_fetch_array () Gets a row from the result set as an associative array, or as 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 the objects in the result that represent the fields.

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 () takes a row from the 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 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 resulting 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 process on 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 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 the MYSQLI and returns the resource used by Mysqli_real_connect ().

MYSQLI_INSERT_ID () returns the ID that was automatically generated in the last query.

Mysql_kill () requests that the server kill a MySQL thread.

Mysqli_more_results () checks if 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 additional connection options that affect the connection behavior.

Mysqli_ping () makes a server connection and attempts to reconnect if the connection is disconnected.

Mysqli_prepare () prepares to execute an SQL statement.

Mysqli_query () executes a query against the database.

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

Mysqli_real_escape_string () escapes 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 () Refreshes the table or cache, or resets the 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 the user custom handle 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 for the last MySQL operation.

Mysqli_ssl_set () is used to create an SSL secure connection.

Mysqli_stat () returns the current system state.

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 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 query that was last executed with Mysqli_real_query ().

Mysqli_warning_count () returns the number of warnings for the last query in the connection.

The above is the "PHP Tutorial" PHP 5 mysqli function content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.