/* Connect to an ODBC database using driver invocation */
$dsn = 'mysql:dbname=...;host=localhost';
$user = '...';
$password = '...';
try {
$dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}public function getDriver() {
if ($this->driver === null || !$this->driver instanceof xPDODriver) {
$_type = $this->config['dbtype'];
if ( empty($_type) ) $_type = "mysql";
$loaded= include_once(XPDO_CORE_PATH . 'om/' . $_type . '/xpdodriver.class.php');
if ($loaded) {
$driverClass = 'xPDODriver_' . $_type;
$this->driver= new $driverClass($this);
}
if (!$this->driver) {
$this->log(xPDO::LOG_LEVEL_ERROR, "Could not load xPDODriver class for the {$_type} PDO driver. " . print_r($this->config, true));
}
}
return $this->driver;
}This question has been answered by opengeek. See the first response.
Trying to get property of non-object in /httpdocs/core/xpdo/xpdo.class.php on line 337
PHP Warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /httpdocs/core/xpdo/xpdo.class.php on line 337
PHP Fatal error: Class 'xPDODriver_' not found in /httpdocs/core/xpdo/xpdo.class.php on line 1825,
PHP Parse error: syntax error, unexpected '{' in /httpdocs/core/config/config.inc.php on line 13