0

Please help,

Error

Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\ecommerce\core\init.php on line 3

My Code

<?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 Answers1

0

You forgot a semicolon, new code:

<?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();
}
?>
Neil
  • 14,063
  • 3
  • 30
  • 51