// DbQuery could now use multiple tables for FROM

This commit is contained in:
Rémi Gaillard
2013-01-18 16:01:31 +01:00
parent b38c9d0484
commit c0e46bbf07
+2 -2
View File
@@ -67,7 +67,7 @@ class DbQueryCore
public function from($table, $alias = null) public function from($table, $alias = null)
{ {
if (!empty($table)) if (!empty($table))
$this->query['from'] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : ''); $this->query['from'][] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : '');
return $this; return $this;
} }
@@ -220,7 +220,7 @@ class DbQueryCore
if (!$this->query['from']) if (!$this->query['from'])
die('DbQuery->build() missing from clause'); die('DbQuery->build() missing from clause');
$sql .= 'FROM '.$this->query['from']."\n"; $sql .= 'FROM '.implode(', ', $this->query['from'])."\n";
if ($this->query['join']) if ($this->query['join'])
$sql .= implode("\n", $this->query['join'])."\n"; $sql .= implode("\n", $this->query['join'])."\n";