Hi before it gave an error that I didn't have the PostGreSQL driver for PDO so I installed it through the command line and changed my pdo.ini file to include it. After I went back to this script and it would not display it would just try to download from firefox. Can someone please tell me what is wrong? Here is the code:
PHP Code:<?php
// Include The Configuration
require_once('configuration.php');
// Database Class
class Database {
// Class Variables
public $status;
private $dbh;
// Connect To The Database
public function __construct($dsn) {
try {
$dbh = new PDO($dsn);
$this->status = 'Connected!';
} catch (PDOException $e) {
$this->status = 'Connection failed: ' . $e->getMessage();
}
}
// Display The Status
public function __toString() {
return $this->status;
}
}
$database = new Database($dsn);
echo $database;
?>




Bookmarks