From 9d43446af276989a554bb59ea64229b4ca52344a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 22 Apr 2005 13:49:36 +0000 Subject: [PATCH] fixed 2 join-related bugs --- etemplate/inc/class.so_sql.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 8bb299078a..d8a697c1af 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -460,8 +460,11 @@ class so_sql { if ($val !== '') { - if (!is_numeric($col)) $col = array_search($col,$this->db_cols); - + // check if a db-internal name conversation necessary + if (!is_numeric($col) && ($c = array_search($col,$this->db_cols))) + { + $col = $c; + } $db_filter[$col] = $val; } } @@ -480,7 +483,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__,false,'',false,0,$join); + $this->db->select($this->table_name,'COUNT(*)',$query,__LINE__,__FILE__); $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)).