first of all, yes, I noticed all other 1000 topics and most of them were about misplaced " and ', I checked my code multiple times and I find everything alright, still, I get this error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/a8438725/public_html/connect.php on line 13
Which line is:
echo "Valoarea errno: " . mysqli_connect_errno() . PHP_EOL;
if I comment that line, I get this error:
Parse error: syntax error, unexpected T_EXIT in /home/a8438725/public_html/connect.php on line 15
this is the full code:
<?php
$servername = "localhost";
$username = "*********";
$password = "*********";
$dbname = "*********";
ini_set('display_errors', 1);
error_reporting(-1);
$db = mysqli_connect($servername, $username, $password, $dbname);
if(!$db){
echo "ERROR: We couldn't connect." . PHP_EOL;
echo "Valoarea errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Valoarea error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
echo "Connected with success!" . PHP_EOL;
echo "Host Info: " . mysqli_get_host_info($db) . PHP_EOL;
?>
I am very sorry if this has been solved already but I can't find the solution, checked multiple tutorials on how to connect it, checked tutorials on the If statement, checked my code, checked every statement that is in my code... there must be something that I did not notice :/