function connect($dsn = '', $user = '', $password = '', $ssl = array())
{
global $ezsql_pdo_str;
$return_val = false;
// Must have a dsn and user
if (!$dsn || !$user) {
$this->register_error($ezsql_pdo_str[1] . ' in ' . __FILE__ . ' on line ' . __LINE__);
$this->show_errors ? trigger_error($ezsql_pdo_str[1], E_USER_WARNING) : null;
}
// Establish PDO connection
try {
if (!empty($ssl)) {
$this->dbh = new PDO($dsn, $user, $password, $ssl);
} else {
$this->dbh = new PDO($dsn, $user, $password);
}
$this->conn_queries = 0;
$return_val = true;
} catch (PDOException $e) {
$this->register_error($e->getMessage());
$this->show_errors ? trigger_error($e->getMessage(), E_USER_WARNING) : null;
}
return $return_val;
}