mysqli_query( $conn, "set names 'utf8'" ); //设置字符编码
mysqli_close( $conn );//关闭连接
$conn = new mysqli( 'localhost', '库名', '库密码' );// 创建连接
if ( $conn->connect_error ) {
die( "连接失败: " . $conn->connect_error );
}// 检测连接
$result = mysqli_query( $conn, $sql );
$row = mysqli_fetch_assoc( $result );//查询语句