I'm trying to get PHP to connect to MySQL and it's not working at all. I can log in and use MySQL from command line, but when I try to connect to it through PHP, all I get is a blank page. No error message or anything. Just to make sure, I searched around for solutions online but nothing seems to be working.
I am using PHP 5.5.9 and MySQL 5.5.43
Here is my code:
<?php
$servername = "127.0.0.1:3306";
$username = "user";
$password = "pass";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";