第4行出错。为什么?我正在尝试连接到mysql数据库,看看它是否连接。我没有得到任何结果。
jcon.php
<?php
require 'config.php';
$con=mysqli_connect(HOST,DBUSER,DBPASS,DB);
if(mysqli_connect_errno($con)){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else{ echo "mysql connected succesfully";}
?>
的config.php
<?php
define( "HOST","localhost");
define ("DB","share");
deifne ("DBUSER";"root");
define ("DBPASS"; "" );
?>
答案 0 :(得分:5)
deifne ("DBUSER";"root");
似乎有问题