diff --git a/include/basis_db.class.php b/include/basis_db.class.php index f5882432b..9f5bc600c 100644 --- a/include/basis_db.class.php +++ b/include/basis_db.class.php @@ -48,6 +48,7 @@ abstract class db extends basis abstract function db_fetch_object($result=null, $i=null); abstract function db_fetch_array($result=null); abstract function db_fetch_row($result=null, $i=null); + abstract function db_fetch_assoc($result=null, $i=null); abstract function db_result($result = null, $i,$item); abstract function db_num_rows($result=null); abstract function db_num_fields($result=null); diff --git a/include/pgsql.class.php b/include/pgsql.class.php index 6db94e03d..bc60c47ab 100644 --- a/include/pgsql.class.php +++ b/include/pgsql.class.php @@ -96,6 +96,24 @@ class basis_db extends db } } + public function db_fetch_assoc($result = null, $i=null) + { + if(is_null($result)) + { + if(is_null($i)) + return pg_fetch_assoc($this->db_result); + else + return pg_fetch_assoc($this->db_result, $i); + } + else + { + if(is_null($i)) + return pg_fetch_row($result); + else + return pg_fetch_row($result, $i); + } + } + public function db_result($result = null, $i,$item) { if(is_null($result))