title: PHP MySQL_connect not working with MAMP
body: <p>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. </p>
  
  <pre><code>&lt;?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");
   ?&gt;
  </code></pre>
  
  <p>I have tried to both use "localhost" and "localhost:8888" for the hostname and "root" and "" as the password. </p>
  
  <p>I am relatively new to this and am trying to self teach myself but I do not see what I am doing wrong. </p>