DBA: The "connected" check for PDO didn't work.
This commit is contained in:
parent
f949747e01
commit
1cbe27de12
1 changed files with 7 additions and 2 deletions
|
@ -222,10 +222,15 @@ class dba {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function connected() {
|
public static function connected() {
|
||||||
|
$connected = false;
|
||||||
|
|
||||||
switch (self::$driver) {
|
switch (self::$driver) {
|
||||||
case 'pdo':
|
case 'pdo':
|
||||||
// Not sure if this really is working like expected
|
$r = dba::p("SELECT 1");
|
||||||
$connected = (self::$db->getAttribute(PDO::ATTR_CONNECTION_STATUS) != "");
|
if (dbm::is_result($r)) {
|
||||||
|
$row = dba::inArray($r);
|
||||||
|
$connected = ($row[0]['1'] == '1');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'mysqli':
|
case 'mysqli':
|
||||||
$connected = self::$db->ping();
|
$connected = self::$db->ping();
|
||||||
|
|
Loading…
Reference in a new issue