<?php $mysqli=@new mysqli("localhost", "root", "123456", "xsphpdb"); if(mysqli_connect_errno()){ echo "连接数据库失败:".mysqli_connect_error(); $mysqli=null; exit; } echo $mysqli->character_set_name()."<br>"; echo $mysqli->get_client_info()."<br>"; echo $mysqli->host_info."<br>"; echo $mysqli->server_info."<br>"; echo $mysqli->server_version."<br>"; $mysqli->close();