php - How to fix unexpected 'else' -
good day! i'm trying connect php program mysql local host. got error saying
parse error: syntax error, unexpected 'else' (t_else) in c:\xampp\htdocs\loginpage\log.php on line 6
here's program:
<?php $connect = new mysqli('localhost','root','','login'); if($connect->connect_error);{ die('connectin failed bruh'); }else echo('connect worked'); ?>
i badly needed help! thanks!
if
statement body closed before start it, need remove semicolon execute statement of if
condition right code should be
if($connect->connect_error){ ............ ............. }
Comments
Post a Comment