From 7f74e935bbc629f5918e426d766f5ce3cac84b8d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Apr 2005 22:09:40 +0000 Subject: [PATCH] small fix count(*) in get_rows uses no LIMIT --- etemplate/inc/class.so_sql.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index d51f6faa46..0a056aa04e 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -369,8 +369,8 @@ class so_sql * deletes row representing keys in internal data or the supplied $keys if != null * * @param array $keys if given array with col => value pairs to characterise the rows to delete - * @return affected rows, should be 1 if ok, 0 if an error - */ + * @return int affected rows, should be 1 if ok, 0 if an error + */ function delete($keys=null) { if (!is_array($keys) || !count($keys)) // use internal data @@ -475,7 +475,7 @@ class so_sql } if ($start !== false) // need to get the total too, saved in $this->total { - $this->db->select($this->table_name,'COUNT(*)',$query,__LINE__,__FILE__,0,'',false,0,$join); + $this->db->select($this->table_name,'COUNT(*)',$query,__LINE__,__FILE__,false,'',false,0,$join); $this->total = $this->db->next_record() ? (int) $this->db->f(0) : false; } $this->db->select($this->table_name,($only_keys === true ? implode(',',$this->db_key_cols) : (!$only_keys ? '*' : $only_keys)). @@ -487,7 +487,7 @@ class so_sql echo "

so_sql::search(,only_keys=$only_keys,order_by='$order_by',wildcard='$wildcard',empty=$empty,$op,start='$start',".print_r($filter,true).") query=".print_r($query,true).", total='$this->total'

\n"; echo "
criteria = "; _debug_array($criteria); } - if ($only_keys == true) // only primary key + if ($only_keys === true) // only primary key { $cols = $this->db_key_cols; }