diff --git a/dblayeroo.php b/dblayeroo.php index e6915b1..8293140 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -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]); }