I am simply connecting to the MySQL database but for the life of me I cannot see or find any proof that the connection succeeded!
In my index.html I have: <?php include 'connect.php';?>
Here is the connect.php:
<?php
$servername = "localhost";
$username = "root";
$password = "password";
$db = "testdb";
// Create connection
$conn = new mysqli($servername, $username, $password, $db);
// Check connection
if ($conn->connect_error) {
// die("Connection failed: " . $conn->connect_error);
trigger_error("Could not connect!",E_USER_ERROR);
echo "<h2>Connection Failed!</h2>";
}
echo "<h2>Connected successfully</h2>";
?>
I’m not seeing anything about the connection! I’m taking it a step at a time. First, connect and verify connection. Then I will actually fetch or store something in the DB.
I’ve looked in the apache2 and mysql logs. Nothing.
I am new to php so I’m probably doing something wrong?
Thanks
Ray