I am working on the tutorial from ProgrammingProfessor on YT. 04 - Connect to a MySQL database in PHP (https://www.youtube.com/watch?v=uXPnY9hQeL0&list=PLhPyEFL5u-i0zEaDF0IPLYvm8zOKnz70r&index=4)
Now I have the code like in the video:
<html>
<head>
</head>
<body>
<h1>hello</h1>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$database_in_use="test";
// Create connection
$mysqli = new mysqli($servername, $username, $password, $database_in_use);
// Check connection
if (mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
echo $mysqli ->host_info. "\n";
?>
</body>
</html>
But I have the Problem that I only get the header displayed at localhost and nothing else.
If I check the sorucecode online I found that it stopped at the header (see picture)
It is not working yet