From fe494abdc1285d57236cd9e7c156e03ca9b23f24 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sun, 19 Oct 2003 18:29:44 +0000 Subject: [PATCH] Fixed count() for postgresql, I hope --- phpgwapi/inc/class.contacts_sql.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.contacts_sql.inc.php b/phpgwapi/inc/class.contacts_sql.inc.php index 391a92221c..b131df811f 100644 --- a/phpgwapi/inc/class.contacts_sql.inc.php +++ b/phpgwapi/inc/class.contacts_sql.inc.php @@ -498,16 +498,17 @@ $sql .= " UPPER($f) LIKE UPPER('%$query%') OR "; $sqlcount .= $sql; } - $sql = substr($sql,0,-3) . ') ' . $fand . $filtermethod . $ordermethod; - $sqlcount = $sql; - unset($f); unset($x); + $_tmp = $sql; + $sql = substr($_tmp,0,-3) . ') ' . $fand . $filtermethod . $ordermethod; + $sqlcount = substr($_tmp,0,-3) . ') ' . $fand . $filtermethod; + unset($_tmp); unset($f); unset($x); } else { $sql = "SELECT id,lid,tid,owner,access,cat_id $t_fields FROM $this->std_table " . $fwhere . $filtermethod . ' ' . $ordermethod; $sqlcount = "SELECT COUNT(id) FROM $this->std_table " . $fwhere - . $filtermethod . ' ' . $ordermethod; + . $filtermethod; } if($DEBUG) {