Server2Go PDO error connection

Posted: October 20, 2010 in Php, Uncategorized

Server2Go PDO error connection

Error message:

Warning: PDO::__construct() [pdo.–construct]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in on line #
Fatal error: Maximum execution time of 60 seconds exceeded in on line #

Change the ‘localhost’ to

$dsn = “mysql:host=;port=$S2G_MYSQL_PORT;dbname=haulagemy”;
$username = “root”;
$password = “”;

try {
           $dbh = new PDO($dsn, $username, $password);
           foreach ($dbh->query(‘SELECT * from tbl_users’) as $row) {
           $dbh = null;
        } catch (PDOException $e) {
           print “Error!: ” . $e->getMessage() . “

View here for more details –>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s