I am coming from a mysql_select_db background and need to get up on mysqli.
I am having trouble connecting with mysqli to my database at Media Temple. I have confirmed that the connection info is correct by connecting via php myAdmin on the MT server. (000000 is substituted below).
my code:
$mysqli = new mysqli("internal-db.000000.gridserver.com", "db000000", "password", "db000000_dbName");
$result = $mysqli->query("select * from 'users'");
$row = $result->fetch_assoc();
echo htmlentities($row['fieldName']);
I receive the following errors:
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
Here's a link on MT's site: http://kb.mediatemple.net/questions/4/Why+can%27t+I+connect+to+my+MySQL+database+from+PHP%3F#gs
What am I missing here? Thanks for reading.