Fixed count() for postgresql, I hope

This commit is contained in:
Miles Lott 2003-10-19 18:29:44 +00:00
parent 6fbf81abed
commit fe494abdc1

View File

@ -498,16 +498,17 @@
$sql .= " UPPER($f) LIKE UPPER('%$query%') OR "; $sql .= " UPPER($f) LIKE UPPER('%$query%') OR ";
$sqlcount .= $sql; $sqlcount .= $sql;
} }
$sql = substr($sql,0,-3) . ') ' . $fand . $filtermethod . $ordermethod; $_tmp = $sql;
$sqlcount = $sql; $sql = substr($_tmp,0,-3) . ') ' . $fand . $filtermethod . $ordermethod;
unset($f); unset($x); $sqlcount = substr($_tmp,0,-3) . ') ' . $fand . $filtermethod;
unset($_tmp); unset($f); unset($x);
} }
else else
{ {
$sql = "SELECT id,lid,tid,owner,access,cat_id $t_fields FROM $this->std_table " . $fwhere $sql = "SELECT id,lid,tid,owner,access,cat_id $t_fields FROM $this->std_table " . $fwhere
. $filtermethod . ' ' . $ordermethod; . $filtermethod . ' ' . $ordermethod;
$sqlcount = "SELECT COUNT(id) FROM $this->std_table " . $fwhere $sqlcount = "SELECT COUNT(id) FROM $this->std_table " . $fwhere
. $filtermethod . ' ' . $ordermethod; . $filtermethod;
} }
if($DEBUG) if($DEBUG)
{ {