From 294285ed8f564c73cf64be69dd9fcc1c76ab4ca3 Mon Sep 17 00:00:00 2001 From: Christian Paminger Date: Thu, 7 Nov 2013 21:29:48 +0000 Subject: [PATCH] db_fetch_assoc --- include/basis_db.class.php | 1 + include/pgsql.class.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) 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))