本文整理匯總了PHP中mysqli::get_server_info方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysqli::get_server_info方法的具體用法?PHP mysqli::get_server_info怎麽用?PHP mysqli::get_server_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mysqli
的用法示例。
在下文中一共展示了mysqli::get_server_info方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getVersion
/**
* Get the version of the database connector.
*
* @return string The database connector version.
*
* @since 1.0
*/
public function getVersion()
{
$this->connect();
return $this->connection->get_server_info();
}
示例2: serverVersion
/**
* Returns the server version string.
*
* @return string
*/
public function serverVersion()
{
return $this->conn->get_server_info();
}
示例3: mysqli
<?php
$mysqli1 = new mysqli();
$mysqli1->connect('localhost', 'root', '123456');
$mysqli1->select_db("mysqlweb");
if (mysqli_connect_errno()) {
echo "error" . $mysqli->connect_error;
} else {
echo "no error";
}
$mysqli1->set_charset('utf8');
var_dump($mysqli1->server_info);
var_dump($mysqli1->client_info);
var_dump($mysqli1->server_version);
echo $mysqli1->get_server_info();
// $sql = 'create table test ( id tinyint auto_increment primary key);';
// var_dump($mysqli1->query($sql));
// $sql2 = "insert into orders( customerid,amount,date) values(5,215.12,'2016-04-02');";
// var_dump($mysqli1->query($sql2));
$sql3 = "update orders set date='2016-04-04' where orderid = 5;";
var_dump($mysqli1->query($sql3), 'sql3');
var_dump($mysqli1->affected_rows);
$sql4 = "delete from orders where orderid=6;";
var_dump($mysqli1->query($sql4), 'sql4');
var_dump($mysqli1->affected_rows);
$sql5 = "select * from orders";
$res = $mysqli1->query($sql5);
var_dump($res);
//返回的結果集中結果的條數
var_dump($res->num_rows);
$num_results = $res->num_rows;