我觉得我正在打死马。我在这里尝试了很多建议,包括;和""和;我一直得到同样的错误。有人可以帮我一把吗? TIA 这是我的代码:
// Connect to the database
$cn = mysqli_connect($db_host, $db_user, $db_pass) or die("Cannot connect to DB");
mysqli_select_db($conn $db_name) or die("Error accessing DB");
这是我的结果:
解析错误:语法错误,意外' $ db_name' (T_VARIABLE)in 第314行的G:\ Apache24 \ htdocs \ poster \ config.inc.php
答案 0 :(得分:1)
答案 1 :(得分:1)
<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>