title: mysqli connection php Media Temple
body: <p>I am coming from a mysql_select_db background and need to get up on mysqli. </p>
  
  <p>I am having trouble connecting with mysqli to my database at Media Temple. <strong>I have confirmed that the connection info is correct by connecting via php myAdmin on the MT server.</strong> (000000 is substituted below).</p>
  
  <p>my code:</p>
  
  <pre><code>$mysqli = new mysqli("internal-db.000000.gridserver.com", "db000000", "password", "db000000_dbName");
  $result = $mysqli-&gt;query("select * from 'users'"); 
  $row = $result-&gt;fetch_assoc();
  echo htmlentities($row['fieldName']);
  </code></pre>
  
  <p>I receive the following errors:</p>
  
  <pre><code>Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL server on 'internal-db.000000.gridserver.com' (61) 
  
  Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli //this is because of the bad connection
  
  Fatal error: Call to a member function fetch_assoc() on a non-object //this is because of the bad connection
  </code></pre>
  
  <p>Here's a link on MT's site:
  <a href="http://kb.mediatemple.net/questions/4/Why+can%27t+I+connect+to+my+MySQL+database+from+PHP%3F#gs" rel="nofollow">http://kb.mediatemple.net/questions/4/Why+can%27t+I+connect+to+my+MySQL+database+from+PHP%3F#gs</a></p>
  
  <p>What am I missing here? Thanks for reading.</p>