more PDO compat
This commit is contained in:
parent
ffb1762280
commit
6b557983c4
@ -175,7 +175,7 @@ class DatabaseConfig extends BaseConfig {
|
|||||||
$this->values = $cached;
|
$this->values = $cached;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->values = $this->database->db->GetAssoc("SELECT name, value FROM config");
|
$this->values = $this->database->db->query("SELECT name, value FROM config")->fetchAll();
|
||||||
$this->database->cache->set("config", $this->values);
|
$this->database->cache->set("config", $this->values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,6 +274,7 @@ class Database {
|
|||||||
global $database_dsn, $cache_dsn;
|
global $database_dsn, $cache_dsn;
|
||||||
|
|
||||||
# FIXME: translate database URI into something PDO compatible
|
# FIXME: translate database URI into something PDO compatible
|
||||||
|
include "config.php";
|
||||||
#$db_proto = $database_dsn;
|
#$db_proto = $database_dsn;
|
||||||
#$db_host = $database_dsn;
|
#$db_host = $database_dsn;
|
||||||
#$db_name = $database_dsn;
|
#$db_name = $database_dsn;
|
||||||
@ -320,7 +321,7 @@ class Database {
|
|||||||
* Execute an SQL query and return a 2D array
|
* Execute an SQL query and return a 2D array
|
||||||
*/
|
*/
|
||||||
public function get_all($query, $args=array()) {
|
public function get_all($query, $args=array()) {
|
||||||
$result = $this->db->fetchAll($query, $args);
|
$result = $this->db->query($query, $args)->fetchAll();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,12 +329,12 @@ class Database {
|
|||||||
* Execute an SQL query and return a single row
|
* Execute an SQL query and return a single row
|
||||||
*/
|
*/
|
||||||
public function get_row($query, $args=array()) {
|
public function get_row($query, $args=array()) {
|
||||||
$result = $this->db->fetch($query, $args);
|
$result = $this->db->query($query, $args)->fetchAll();
|
||||||
if(count($result) == 0) {
|
if(count($result) == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $result;
|
return $result[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user