From fe7814b64cc4fdea98376908416e6d3bcf7d17ee Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 14 May 2012 18:03:42 +0000 Subject: [PATCH] Prepend table name to avoid ambiguity --- etemplate/inc/class.so_sql.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 01a372885a..374abd4d0e 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -931,7 +931,12 @@ class so_sql } if ($only_keys === true) { - $colums = implode(',',array_keys($this->db_key_cols)); + $colums = array_keys($this->db_key_cols); + foreach($colums as &$column) + { + $column = $this->table_name . '.' . $column; + } + $colums = implode(',',$colums); if (!empty($colums)) $colums = ' DISTINCT '.$colums; } elseif (is_array($only_keys))