$mysqli = new mysqli('localhost','root','123','test');
//检查连接是否成功
if (mysqli_connect_error()){
//注意mysqli_connect_error()新特性
die('Unable to connect!'). mysqli_connect_error();
}
$sql = "select * from user";
$query = $mysqli->query($sql);
$order_mes = mysqli_fetch_array($query);

/* Close the connection 关闭连接*/
mysqli_close($mysqli);

05-11 17:43