PHP - MySQL Functions
PHP MySQLi functions gives to access the MySQLi database servers. PHP works with MySQLi version 4.1.13 or newer.
Installation
MySQLi extension was introduced with PHP version 5.0.0 and MySQLi native Driver was included in PHP version 5.3.0.
Installation details are available at here
List of Functions
PHP − indicates the earliest version of PHP that supports the function.
Sr.No | Function & Description | PHP |
---|---|---|
1 | mysqli affected rows
It returns the number of affected rows in the previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query. |
4 |
2 | mysqli client encoding
It is used to turn off or turn of auto-committing database modifications. |
4.3.0 |
3 | mysqli close
It is used to close MySQLi connection |
4 |
4 | mysqli connect
It opens a connection to a MySQLi Server |
4 |
5 | mysqli create db
It is used to create MySQLi connection |
5 |
6 | mysqli change user
It is used to set the current database connection insted of specified data base connection. |
5 |
7 | mysqli character set name
It is returns default character set for the database connection |
5 |
8 | connect errno
It returns the error code from the last connection |
5 |
9 | data seek
It is used to move internal result pointer. |
4 |
10 | mysqli debug
It is used to performs debugging operations |
5 |
11 | dump debug info
It is used dumps debugging info into the log |
5 |
12 | mysqli error list
It returns a list of errors from the last connection |
4 |
13 | mysqli_error
It returns the last error description for the most recent function |
4 |
14 | mysqli fetch all
It is used to fetchs all result rows and returns the result set as an associative array |
4 |
15 | mysqli fetch array
It is used to fetchs a result row as an associative array |
5 |
16 | mysqli fetch assoc
It is used to fetches a result row as an associative array. |
5.3 |
17 | mysqli fetch field direct
It is used to returns the next column in the result set as an object. |
4 |
18 | mysqli fetch fields
It is used to returns an array of objects |
4 |
19 | mysqli fetch lengths
It is used to returns the length of the fields in the result |
4 |
20 | mysqli fetch object
It returns an object |
5 |
21 | mysqli field count
It returns the number of columns for the most recent query. |
5 |
22 | mysqli field seek
This function sets the column cursor to the given column offset. |
5 |
23 | mysqli field tell
It returns returns the position of the field cursor. |
5 |
24 | mysqli_free_result
It frees the memory associated with the result. |
5 |
25 | mysqli get charset
It returns a character set object. |
4 |
26 | mysqli get client info
It returns the MySQL client library version. |
5 |
27 | mysqli get client stats
It returns statistics about client per-process. |
5 |
28 | mysqli get client version
It returns the MySQLi client library version. |
5.1.0 |
29 | mysqli get connection stats
It returns statistics about the client connection. |
5 |
30 | mysqli get host info
It returns the MySQLi server hostname and the connection type. |
5 |
31 | mysqli get proto info
It returns the MySQLi protocol version information |
5 |
32 | mysqli get server info
It returns the MySQLi server information. |
5 |
33 | mysqli info
It returns information about the most recently executed query. |
5 |
34 | mysqli init
It returns an object to use with the mysqli_real_connect() function. |
5 |
35 | mysqli insert id
It returns an id of last query. |
5 |
36 | mysqli kill
This function asks to the server to kill MySQLi thread specified by the processid parameter. |
5 |
37 | mysqli more results
This function checks if there are more results from a multi query. |
5 |
38 | mysqli multi query
It used to separate the queries with a semicolon against the database. |
5 |
39 | mysqli next result
It prepares the next result set from mysqli_multi_query(). |
5 |
40 | mysqli num fields
It returns the number of fields in a result set |
5 |
41 | mysqli num rows
It returns the number of rows in a result set |
5 |
42 | mysqli options
It is used to sets connect options and change connection settings. |
5 |
43 | mysqli ping
It is used to pings a server connection and reconnect to server if connection is lost. |
5 |
44 | mysqli query
It performs a query against the database. |
5 |
45 | mysqli query
It performs a query against the database. |
5 |
46 | mysqli real connect
This function opens a new connection to the MySQLi |
5 |
47 | mysqli real escape string
This function escapes special characters in a string for an SQL statement. |
5 |
48 | mysqli refresh
This function refreshes tables or caches, or resets the replication server information. |
5 |
49 | mysqli rollback
This function rolls back the current transaction for the specified database connection. |
5 |
50 | mysqli select db
This function changes the default database. |
5 |
51 | mysqli set charset
It function sets the default character set. |
5 |
52 | mysqli sqlstate
This function returns the SQLSTATE error code for the last error. |
5 |
53 | mysqli ssl set
This function creates an SSL connection. |
5 |
54 | mysqli_stat
This function returns the current system status. |
5 |
55 | mysqli_stmt_init
This function initializes a statement and returns an object suitable for mysqli_stmt_prepare(). |
5 |
56 | mysqli thread id
This function returns the current connection thread ID. |
5 |
57 | mysqli thread safe
This function verified whether the client library is compiled as thread-safe. |
5 |