diff --git a/dblayeroo.php b/dblayeroo.php index b3860c2..7b1cf8e 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -1599,7 +1599,9 @@ class dblayeroo if (isset ($this->fieldsTmp)) $displayColumns = implode (",", array_keys ($this->fieldsTmp)); else - $displayColumns = "*"; + $displayColumns = $this->sep. + implode ($this->sep.",".$this->sep, array_keys ($this->fields)). + $this->sep; } $sql .= " $displayColumns FROM $this->sep$this->tableprefix". "$this->table$this->sep"; @@ -1957,7 +1959,7 @@ class dblayeroo // overwrite with the same value) // If it is not the same, produce an error $objTmp->whereAdd ($this->primary, "!=", - $resUpdate[0][$this->primary]); + $resUpdate[0][$this->table.".".$this->primary]); } if (count ($errors) == 0 && count ($objTmp->execute ())) $this->DBException (dgettext ("domframework", @@ -2043,6 +2045,8 @@ class dblayeroo // the filled value) if (isset ($this->fieldsTmp)) $columns = array_keys ($this->fieldsTmp); + elseif (count ($this->displayColumn)) + $columns = $this->displayColumn; else $columns = array_keys ($this->fields); foreach ($result as $rownb=>$row) @@ -2056,9 +2060,17 @@ class dblayeroo "integer") $val = intval ($val); } - elseif (isset ($this->fields)) + elseif (count ($this->displayColumn)) { - if (strtolower ($this->fields[$columns[$colNb]][0]) === "integer") + $fieldWithoutTable = substr ($columns[$colNb], + strlen ($this->sep.$this->table.$this->sep.".".$this->sep), -1); + if (strtolower ($this->fields[$fieldWithoutTable][0]) === "integer") + $val = intval ($val); + } + else + { + if (strtolower ($this->fields[$columns[$colNb]][0]) === + "integer") $val = intval ($val); } $colName = str_replace ($this->sep, "", $columns[$colNb]);