21,886
社区成员
发帖
与我相关
我的任务
分享
header("Content-Type: text/html; charset=utf-8");
$db_host='127.0.0.1';
$db_host='192.168.0.22';
$db_user='root';
$db_pwd='';
$db_name='iq1';
@$mysqli=new mysqli($db_host,$db_user,$db_pwd,$db_name);
if (mysqli_connect_errno()){
$str='<fieldset><legend>数据库连接失败</legend>';
$str.="<p>可能的原因有:数据库防火墙未关闭、数据库服务未启用</p>";
$str.="<p>返回的错误信息是 %s</p>";
$str.="</fieldset>";
printf ($str,mysqli_connect_error());
exit();
};
?>
header("Content-Type: text/html; charset=utf-8");