2017-04-11 49 views
0

請幫幫忙,解析錯誤一邊寫代碼

Error

解析錯誤:語法錯誤,意想不到的 '如果'(T_IF)在C:\ XAMPP \ htdocs中\上線電子商務\核心\的init.php 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(); 
} 
?> 
+0

檢查此問題http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them –

回答

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(); 
} 
?> 
+0

非常感謝!您的解決方案奏效 –

+0

嘿,如果你可以標記爲解決方案,它會幫助很多。點擊綠色的勾號。 – Neil