mysqli连接数据库函数

<?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();

 

posted @ 2015-12-04 15:23  对数螺旋线  阅读(234)  评论(0编辑  收藏  举报