FUNCTION NAME |
FUNCTION DESCRIPTION |
FUNCTION SYNTAX |
FUNCTION RETURN VALUE |
mysqli::$host_info()
mysqli_get_host_info()
[mysqli::$host_info — mysqli_get_host_info – Returns a string representing the type of connection used] |
This function returns a string describing (‘giving information about’) the connection represented by $mysqli [object-oriented]/mysqli_link [procedural] (including the server host name). |
Object-oriented style:
$mysqli->host_info;
Procedural style:
mysqli_get_host_info(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$host_info() : returns a character string representing the server hostname and the connection type. |
mysqli::$protocol_version()
mysqli_get_proto_version()
[mysqli::$protocol_version — mysqli_get_proto_version – Returns the version of the MySQL protocol used] |
This function returns an integer representation of the MySQL protocol version used by the connection represented by the $mysqli [object-oriented]/mysqli_link [procedural] parameter. |
Object-oriented style:
$mysqli->protocol_version;
Procedural style:
mysqli_get_proto_info(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$protocol_version() : returns an integer representation of the protocol version. |
mysqli::$server_info()
mysqli::get_server_info()
mysqli_get_server_info()
[mysqli::$server_info — mysqli::get_server_info — mysqli_get_server_info – Returns the version of the MySQL server] |
This function returns a string representation of [‘information about’] the MySQL server version that the MySQLi extension is connected to. |
Object-oriented style – flavour one:
$mysqli->server_info;
Object-oriented style – flavour two:
mysqli::get_server_info();
Procedural style:
mysqli_get_server_info(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$server_info() : returns a character string representing the MySQL server version. |
mysqli::$server_version()
mysqli_get_server_version()
[mysqli::$server_version — mysqli_get_server_version – Returns the version of the MySQL server as an integer] |
This function returns the version of the server connected to [represented by $mysqli (object-oriented style) / mysqli_link (procedural style)] as an integer. |
Object-oriented style:
$mysqli->server_version;
Procedural style:
mysqli_get_server_version(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$server_version() : returns an integer representation of the MySQL server version. This integer representation takes the following form: main_version * 10000 + minor_version * 100 + sub_version (thus, version 4.1.0 is returned as 40100). |
mysqli::get_warnings()
mysqli_get_warnings()
[mysqli::get_warnings — mysqli_get_warnings – Get result of SHOW WARNINGS] |
This function returns [‘gets’] an array of mysqli warnings. Each warning object has three properties: message , sqlstate , and errno . The array can be traversed using the next() function of the mysqli_warning class. |
Object-oriented style:
$mysqli->get_warnings();
Procedural style:
mysqli_get_warnings(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::get_warnings() : returns an array of mysqli warning objects; this array can be navigated using the next() function of the mysqli_warning class. |
mysqli::$info()
mysqli_info()
[mysqli::$info — mysqli_info – Retrieves information about the most recently executed query] |
This function returns an informative string about the most recently executed mysqli query. For queries of the form INSERT INTO...SELECT /INSERT INTO...VALUES (...),(...),(...) /ALTER TABLE... , the returned string is of the form Records: #, Duplicates: #, Warnings: #. Where the query is of the form LOAD DATA INFILE... , the returned string is of the form Records: #, Deleted: #, Skipped: #, Warnings: #. For queries of the form UPDATE... , the returned string is of the form Rows Matched: #, Changed: #, Warnings: #. |
Object-oriented style:
$mysqli->info;
Procedural style:
mysqli_info(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$info() : returns a character string representing additional information about the most recently executed query. Queries that are not of the form INSERT INTO...SELECT / INSERT INTO...VALUES (...),(...),(...) / ALTER TABLE... / LOAD DATA INFILE... / UPDATE... are not supported, and will return an empty string. |
mysqli::init()
mysqli_init()
[mysqli::init — mysqli_init – Initializes MySQLi and returns a resource for use with mysqli_real_connect()] |
This function allocates or initializes a MySQL object suitable for use in conjunction with the mysqli_options() and mysqli_real_connect() functions. With the exception of mysqli_options() , subsequent calls to any MySQLi function will fail until mysqli_real_connect() is called. |
Object-oriented style:
$mysqli->init();
Procedural style:
mysqli_init(); |
mysqli::init() : returns a MySQL object. |
mysqli::$insert_id()
mysqli_insert_id()
[mysqli::$insert_id — mysqli_insert_id – Returns the auto generated ID used in the latest query] |
This function returns the ID generated by a query (usually INSERT ) on a table with a column having the AUTO INCREMENT attribute. If no INSERT or UPDATE statements were sent via this connection, or if the modified table does not have a column with the AUTO-INCREMENT property, this function returns 0. |
Object-oriented style:
$mysqli->insert_id;
Procedural style:
mysqli_insert_id(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::$insert_id() : returns the value of the AUTO_INCREMENT field that was updated by the previous query. Returns zero if the query did not update an AUTO_INCREMENT field, or if there was no previous query on the connection. If the maximal int value is exceeded, a string will be returned instead. |
mysqli::kill()
mysqli_kill()
[mysqli::kill — mysqli_kill – Asks the server to kill a MySQL thread] |
This function is used to ask the server to kill a MySQL thread. The processid parameter specifies which MySQL thread to kill. The processid value must be obtained by calling the mysqli_thread_id() function. The SQL command KILL QUERY processid should be used to stop a running query. |
Object-oriented style:
$mysqli->kill(processid);
Procedural style:
mysqli_kill(mysqli_link, processid);
[processid: specifies which MySQL thread to kill.
mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::kill() : returns TRUE on success; FALSE on failure. |
mysqli::more_results()
mysqli_more_results()
[mysqli::more_results — mysqli_more_results – Check if there are any more query results from a multi query] |
This function is used to indicate if one or more result sets are available from a previous call to mysqli_multi_query() . |
Object-oriented style:
$mysqli->more_results();
Procedural style:
mysqli_more_results(mysqli_link);
[mysqli_link: a link identifier returned by mysqli_connect() or mysqli_init() ; only required for the procedural style.] |
mysqli::more_results() : returns TRUE if one or more result sets are available from a previous call to mysqli_multi_query() ; otherwise FALSE. |
Leave a Reply