标签:head 脚本 charset char host 默认 roo mysqli DBName
语法:USE 数据库名;
语法:mysqli_select_db(connection,dbname);
举个例子
<?php
header("content-type:text/html;charset=utf-8");
$dbhost=‘localhost‘;
$dbuser=‘root‘;
$dbpass=‘asdasd‘;
$conn=mysqli_connect($dbhost,$dbuser,$dbpass);
if (!$conn)
{
die(‘连接失败:‘.mysqli_error($conn));
}
echo ‘连接成功‘;
mysqli_select_db($conn,‘bird‘);
mysqli_close($conn);
?>
标签:head 脚本 charset char host 默认 roo mysqli DBName
原文地址:https://www.cnblogs.com/ceiling-/p/14397632.html