mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +01:00
"fixed ambiguous column sql-error by adding table-name to id over which we join"
This commit is contained in:
parent
a45ea03b19
commit
f2e9a38ff4
@ -922,7 +922,7 @@ class so_sql
|
||||
// add table-name to otherwise ambiguous id over which we join (incl. "AS id" to return it with the right name)
|
||||
if ($join && $this->autoinc_id && strpos($colums,$this->autoinc_id) !== false)
|
||||
{
|
||||
$colums = preg_replace('/([ ,]+)'.preg_quote($this->autoinc_id).'([ ,]+)/','\\1'.$this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id.'\\2',$colums);
|
||||
$colums = preg_replace('/(?<! AS)([ ,]+)'.preg_quote($this->autoinc_id).'([ ,]+)/','\\1'.$this->table_name.'.'.$this->autoinc_id.' AS '.$this->autoinc_id.'\\2',$colums);
|
||||
}
|
||||
$num_rows = 0; // as spec. in max_matches in the user-prefs
|
||||
if (is_array($start)) list($start,$num_rows) = $start;
|
||||
|
Loading…
Reference in New Issue
Block a user