时间:2021-07-01 10:21:17 帮助过:34人阅读
语法: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);
?>
MySQL——选择数据库
标签:head 脚本 charset char host 默认 roo mysqli DBName