编写代码时解析错误

时间:2017-04-11 07:15:39

标签: php parsing

请帮忙,

  

错误

解析错误:语法错误,意外情况'如果'第3行的C:\ xampp \ htdocs \ ecommerce \ core \ init.php中的(T_IF)

  

我的代码

<?php
$db = mysqli_connect('127.0.0.1','root','','kidsshowroom')
if(mysqli_connect_errno()) {
  echo 'Database Connection failed with the following errors: '.mysqli_connect_error();
  die();
}
?>

1 个答案:

答案 0 :(得分:0)

你忘记了一个分号,新代码:

<?php
$db = mysqli_connect('127.0.0.1','root','','kidsshowroom');
if(mysqli_connect_errno()) {
    echo 'Database Connection failed with the following errors: '.mysqli_connect_error();
    die();
}
?>