I have installed Mamp and PHPMyAdmin and have created a database(test_db), However the following code does not seem to connect to the server.
<?php
//Sets database connection info
$hostname = "localhost:8888";
$username="root";
$password="root";
$db="test_db";
//starts MySQL connection
mysql_connect($hostname, $username, $password)
or die("MySQL Connection failure.");
mysql_select_db($db)
or die("Database could not be found");
?>
I have tried to both use "localhost" and "localhost:8888" for the hostname and "root" and "" as the password.
I am relatively new to this and am trying to self teach myself but I do not see what I am doing wrong.