Loading... # PHP MySQLi Functions The following section contains a list of PHP MySQLi functions along with a brief description. PHP MySQLi Functions The mysqli functions are designed to communicate with MySQL 4.1 or later versions. Using the mysqli functions you can take advantage of all the latest and advanced features of MySQL, which you may not be able to do with the earlier MySQL functions. mysqli\_affected\_rows() Returns the number of affected rows in the previous MySQL operation. --- mysqli\_autocommit() Turns on or off auto-committing database modifications. --- mysqli\_change\_user() Changes the user of the specified database connection. --- mysqli\_character\_set\_name() Returns the default character set for the database connection. --- mysqli\_close() Closes a previously opened database connection. --- mysqli\_commit() Commits the current transaction. --- mysqli\_connect\_errno() Returns the error code from the last connect call. --- mysqli\_connect\_error() Returns the error description from 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 debugging operations. --- mysqli\_dump\_debug\_info() Dumps debugging information into the log. --- mysqli\_errno() Returns the error code for the most recent function call. --- mysqli\_error\_list() Returns a array of errors for the most recent MySQLi function call. --- mysqli\_error() Returns the last error message for the most recent MySQLi function call. --- mysqli\_fetch\_all() Fetches all result rows as an associative array, a numeric array, or both. --- mysqli\_fetch\_array() Fetches a result row as an associative, a numeric array, or both. --- mysqli\_fetch\_assoc() Fetches a result row as an associative array. --- mysqli\_fetch\_field\_direct() Fetch meta-data for a single field as an object. --- mysqli\_fetch\_field() Returns the next field in the result set, as an object. --- mysqli\_fetch\_fields() Returns an array of objects representing the fields in a result set. --- mysqli\_fetch\_lengths() Returns the lengths of the columns of the current row in the result set. --- mysqli\_fetch\_object() Returns the current row of a result set as an object. --- mysqli\_fetch\_row() Fetches one row of data 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 result pointer to a specified field offset. --- mysqli\_field\_tell() Returns the position of the field cursor used for the last mysqli\_fetch\_field() call. --- mysqli\_free\_result() Frees the memory associated with a result. --- mysqli\_get\_charset() Returns a character set object. --- mysqli\_get\_client\_info() Returns the MySQL client version as a string. --- mysqli\_get\_client\_stats() Returns client per-process statistics. --- mysqli\_get\_client\_version() Returns the MySQL client version as an integer. --- mysqli\_get\_connection\_stats() Returns client connection statistics. --- mysqli\_get\_host\_info() Returns a string representing the type of connection used including the MySQL server hostname. --- mysqli\_get\_proto\_info() Returns the version of the MySQL protocol used. --- mysqli\_get\_server\_info() Returns the version of the MySQL server. --- mysqli\_get\_server\_version() Returns the version of the MySQL server as an integer. --- mysqli\_info() Returns information about the last query executed. --- mysqli\_init() Initializes MySQLi and returns a resource for use with mysqli\_real\_connect() --- mysqli\_insert\_id() Returns the auto-generated id used in the last query. --- mysqli\_kill() Asks the server to kill a MySQL thread. --- mysqli\_more\_results() Check if there are any more query results from a multi query. --- mysqli\_multi\_query() Performs one or multiple queries on the database. --- mysqli\_next\_result() Prepares the next result set from mysqli\_multi\_query() --- mysqli\_num\_fields() Returns the number of fields in a result set. --- mysqli\_num\_rows() Returns the number of rows in a result set. --- mysqli\_options() Sets extra connect options and affect behavior for a connection. --- mysqli\_ping() Pings a server connection, or tries to reconnect if the connection has gone down. --- mysqli\_prepare() Prepares an SQL statement for execution. --- mysqli\_query() Performs a query on the database. --- mysqli\_real\_connect() Opens a connection to a mysql server. --- mysqli\_real\_escape\_string() Escapes special characters in a string for use in an SQL statement. --- mysqli\_real\_query() Executes an SQL query. --- mysqli\_refresh() Refreshes tables or caches, or resets the replication server information. --- mysqli\_rollback() Rollbacks the current transaction for the database. --- mysqli\_select\_db() Selects the default database for database queries. --- mysqli\_set\_charset() Sets the default client character set. --- mysqli\_set\_local\_infile\_default() Unsets user defined handler for load local infile command. --- mysqli\_set\_local\_infile\_handler() Set callback function for LOAD DATA LOCAL INFILE command. --- mysqli\_sqlstate() Returns the SQLSTATE error code from the previous MySQL operation. --- mysqli\_ssl\_set() Used to establish secure connections using SSL. --- mysqli\_stat() Returns the current system status. --- mysqli\_stmt\_init() Initializes a statement and returns an object for use with mysqli\_stmt\_prepare() --- mysqli\_store\_result() Transfers a result set from the last query. --- mysqli\_thread\_id() Returns the thread ID for the current connection. --- mysqli\_thread\_safe() Returns whether the client library is compiled as thread-safe. --- mysqli\_use\_result() Initiates the retrieval of a result set from the last query executed using the mysqli\_real\_query() --- mysqli\_warning\_count() Returns the number of warnings from the last query in the connection. Last modification:September 15, 2024 © Allow specification reprint Like 如果觉得我的文章对你有用,请随意赞赏