diff --git a/dblayer.php b/dblayer.php index 6995114..bff4426 100644 --- a/dblayer.php +++ b/dblayer.php @@ -188,8 +188,13 @@ class dblayer extends PDO throw new Exception (sprintf (_("Field %s not allowed"), $f), 506); } } + else + { + $display = array_keys ($this->fields); + } + $req = "SELECT "; - $req .= implode (",", array_keys ($this->fields)); + $req .= implode (",", $display); $req .= " FROM `".$this->table."`"; if ($select !== null) { @@ -360,6 +365,15 @@ class dblayer extends PDO $st->execute (); return $st->rowCount(); } + + /** Translation of fields */ + public function titles () + { + $arr = array (); + foreach ($this->fields as $field=>$v) + $arr[$field] = $field; + return $arr; + } } /** POC :