// 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

View File

@@ -67,7 +67,7 @@ class DbQueryCore
public function from($table, $alias = null)
{
if (!empty($table))
$this->query['from'] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : '');
$this->query['from'][] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : '');
return $this;
}
@@ -220,7 +220,7 @@ class DbQueryCore
if (!$this->query['from'])
die('DbQuery->build() missing from clause');
$sql .= 'FROM '.$this->query['from']."\n";
$sql .= 'FROM '.implode(', ', $this->query['from'])."\n";
if ($this->query['join'])
$sql .= implode("\n", $this->query['join'])."\n";