dblayeroo: Update Alias support
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3822 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -2724,12 +2724,16 @@ class dblayeroo
|
||||
$columns = array ();
|
||||
foreach ($this->displayGet (false) as $col)
|
||||
{
|
||||
$pos = strpos ($col, "(");
|
||||
if ($pos !== false)
|
||||
$columns[] = substr ($col, 0, $pos+1).
|
||||
substr ($col, $pos+2, -2).")";
|
||||
else
|
||||
$columns[] = substr ($col, 1 + strrpos ($col, $this->sep, -2), -1);
|
||||
$col = str_replace ($this->sep.$this->tableprefix.$this->table.
|
||||
$this->sep.".", "", $col);
|
||||
if ($col[0] === $this->sep)
|
||||
$col = substr ($col, 1);
|
||||
if (substr ($col, -1) === $this->sep &&
|
||||
strpos ($col, " AS ".$this->sep) === false)
|
||||
{
|
||||
$col = substr ($col, 0, -1);
|
||||
}
|
||||
$columns[] = $col;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2754,7 +2758,13 @@ class dblayeroo
|
||||
elseif (strtolower ($fieldsAll[$columns[$colNb]][0]) ===
|
||||
"integer")
|
||||
$val = intval ($val);
|
||||
$colName = str_replace ($this->sep, "", $columns[$colNb]);
|
||||
if (($pos = strpos ($columns[$colNb], " AS ".$this->sep)) !== false)
|
||||
{
|
||||
$pos += strlen (" AS ".$this->sep);
|
||||
$colName = substr ($columns[$colNb], $pos, -1);
|
||||
}
|
||||
else
|
||||
$colName = str_replace ($this->sep, "", $columns[$colNb]);
|
||||
$result[$rownb][$colName] = $val;
|
||||
unset ($result[$rownb][$colNb]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user