MySQLi – Useful Functions
”;
Here is the list of all important MySQLi functions. Each function has been explained along with suitable example.
-
mysqli::$affected_rows − It used to get the information about number of affected rows in a previous MySQL operation
-
mysqli::autocommit − It used to turn on or off auto-committing database modifications operation
-
mysqli::begin_transaction − It used to start a transaction
-
mysqli::change_user − It used to change the user of the specified database connection
-
mysqli::character_set_name – It returns the default character set for the database connection.
-
mysqli::$client_info − It is used to get MySQL client info.
-
mysqli::$client_version − It returns the MySQL client version as a string.
-
mysqli::close − It closes a previously opened database connection.
-
mysqli::commit − It commits the current transaction.
-
mysqli::$connect_errno − It returns the error code from last connect call.
-
mysqli::connect_error − It returns a string description of the last connect error.
-
mysqli::__construct − It used to open a new connection to the MySQL server
-
mysqli::debug − It used to performs debugging operations
-
mysqli::dump_debug_info − It is used to dump debugging information into the log
-
mysqli::$errno − It returns the error code for the most recent function call
-
mysqli::$error_list − It returns a list of errors from the last command executed
-
mysqli::$error − It returns a string description of the last error
-
mysqli::$field_count − It returns the number of columns for the most recent query
-
mysqli::get_charset − It returns a character set object
-
mysqli::get_client_info − It is used to get MySQL client info
-
mysqli::mysqli_get_client_stats − It returns client per-process statistics
-
mysqli::mysqli_get_client_version − It returns the MySQL client version as an integer
-
mysqli::get_connection_stats − It returns statistics about the client connection
-
mysqli::$host_info − It returns a string representing the type of connection used
-
mysqli::$protocol_version − It returns the version of the MySQL protocol used
-
mysqli::$server_info − It returns the version of the MySQL server
-
mysqli::$server_version − It returns the version of the MySQL server as an integer
-
mysqli::get_warnings − It is used to get result of SHOW WARNINGS
-
mysqli::$info − It retrieves information about the most recently executed query
-
mysqli::$insert_id − It returns the auto generated id used in the latest query
-
mysqli::kill − It asks the server to kill a MySQL thread
-
mysqli::more_results − It used to check if there are any more query results from a multi query
-
mysqli::multi_query − It performs a query on the database
-
mysqli::next_result − It prepares next result from multi_query
-
mysqli::options − It used to set options
-
mysqli::ping − It is used to ping a server
-
mysqli::poll − It used to poll connections
-
mysqli::prepare − It used to prepare an SQL statement for execution.
-
mysqli::query − It is used to perform a query on the database.
-
mysqli::real_connect − It opens a connection to a mysql server.
-
mysqli::real_escape_string − It escapes special characters in a string for use in an SQL statement
-
mysqli::real_query − It is used to execute an SQL query.
-
mysqli::real_async_query − It is used to get result from async query
-
mysqli::refresh − It used to refresh an SQL statement for execution.
-
mysqli::release_savepoint − It removes the named savepoint from the set of savepoints of the current transaction
-
mysqli::rollback − It rolls back current transaction
-
mysqli::rpl_query_type − It returns RPL query type
-
mysqli::select_db − It is used to selects the default database for database queries
-
mysqli::send_query − It is used to send the query and return
-
mysqli::set_charset − It sets the default client character set
-
mysqli::set_local_infile_default − It is used to unsets user defined handler for load local infile command
-
mysqli::set_local_infile_handler − It is used to set callback function for LOAD DATA LOCAL INFILE command
-
mysqli::$sqlstate − It returns the SQLSTATE error from previous MySQL operation.
-
mysqli::ssl_set − It is used for establishing secure connections using SSL
-
mysqli::stat − It is used to set callback function for LOAD DATA LOCAL INFILE command
-
mysqli::stmt_init − It is used to initialize a statement and returns an object for use with mysqli_stmt_prepare.
-
mysqli::mysqli::$thread_id − It returns the thread ID for the current connection
-
mysqli::thread_safe − It returns whether thread safety is given or not.
-
mysqli::use_result − It is used to initiate a result set retrieval
-
mysqli::$warning_count − It returns the number of warnings from the last query for the given link
”;