function __construct($db) {
$db = is_scalar($db) ? array('name' => $db) : $db;
- foreach ($db as $k=>$v) $this->$k = $v;
+ if (is_array($db)) {
+ foreach ($db as $k=>$v) $this->$k = $v;
+ }
$this->type = strtolower(preg_replace('/^([^:]+):.*$/','\1',$this->pdo));
#preg_match_all('/[:;](user|username|password)=([^;]*)/',$this->pdo,$m); bye($m);
$sql = "SHOW TABLES";
} else {
- err('db.tables(): Unknow db type: '.$this->type);
+ $this->bye('db.tables(): Unknow db type: '.$this->type);
return array();
}