pdo changes first cut

This commit is contained in:
zotlabs
2016-10-19 16:58:26 -07:00
parent c79c1b3913
commit aee4f8d2fe
2 changed files with 27 additions and 30 deletions

View File

@@ -9,11 +9,12 @@ class dba_pdo extends dba_driver {
function connect($server,$port,$user,$pass,$db) {
$this->driver_dbtype = 'mysql'; // (($dbtype == DBTYPE_POSTGRES) ? 'postgres' : 'mysql');
$this->driver_dbtype = 'mysql';
$dns = $this->driver_dbtype
. ':host=' . $server . (is_null($port) ? '' : ';port=' . $port)
. ';dbname=' . $db;
db_logger('dns: ' . $dns);
try {
$this->db = new PDO($dns,$user,$pass);