title: MAMP: Cannot do MySQL queries
body: <p>Some background: I initially tried doing Apache, MySql, and PHP on windows, each installed separately (what a PITA that was!). Eventually I heard that I would be better suited on the mac, so I got the MAMP.</p>
  
  <p>Glad to find that everything has been installed, I try playing around with it. Basically everything works, except for MySQL queries (I am trying to insert data into a table).</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;h1&gt;hello world&lt;/h1&gt;
  &lt;?php
  echo "hello ";
  echo date('H:i:s, jS F Y');
  $link = mysql_connect('localhost', 'root', 'root');
  if ($link)
      echo "success";
  else
      echo "failure";
  
  $db_selected = mysql_select_db('MyDB', $link);
  if ($db_selected) 
      echo "success";
  else
      echo "failure";
  
  $my_query = mysql_query($link,"INSERT INTO comments (cName, cComment)
  VALUES ('Peter', 'Hellloooooo')");
  
  if ($my_query)
      echo "success";
  else
      echo "failure";
  
  mysql_close($link);
  ?&gt;
  </code></pre>
  
  <p>My output looks like the following:</p>
  
  <blockquote>
    <p>hello world</p>
    
    <p>hello 00:14:12, 19th March 2013successsuccessfailure</p>
  </blockquote>
  
  <p>As you can see, mysql_connect and mysql_select_db work, but mysql_query does not. I've spent many fruitless hours trying to figure this out. What is wrong with the code? </p>