Oracle 5.0 Reference Manual page 2761

Table of Contents

Advertisement

$mysqli = new mysqli("localhost", "root", "", "test");
var_dump($mysqli->server_version);
?>
The above example will output:
proxy::getServerVersion(array (
0 => NULL,
))
proxy::getServerVersion returns 50145
int(50145)
See Also
mysqlnd_uh_set_connection_proxy
mysqli_get_server_version
mysql_get_server_version
20.7.8.7.19.
MysqlndUhConnection::getSqlstate
Copyright 1997-2012 the PHP Documentation Group. [2230]
MysqlndUhConnection::getSqlstate
Returns the SQLSTATE error from previous MySQL operation
Description
public string MysqlndUhConnection::getSqlstate(
mysqlnd_connection connection);
Returns the SQLSTATE error from previous MySQL operation.
Parameters
connection
Return Values
The SQLSTATE code.
Examples
Example 20.354.
<?php
class proxy extends MysqlndUhConnection {
public function getSqlstate($res) {
printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
$ret = parent::getSqlstate($res);
printf("%s returns %s\n", __METHOD__, var_export($ret, true));
return $ret;
}
}
mysqlnd_uh_set_connection_proxy(new proxy());
$mysqli = new mysqli("localhost", "root", "", "test");
var_dump($mysqli->sqlstate);
$mysqli->query("AN_INVALID_REQUEST_TO_PROVOKE_AN_ERROR");
var_dump($mysqli->sqlstate);
?>
Mysqlnd user handler plugin (mysqlnd_uh)
Mysqlnd connection handle. Do not modify!
MysqlndUhConnection::getSqlstate
example
2741

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents