From 7c2ea07315d562cd6d3662b80d734eaf45693244 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 26 Mar 2014 19:58:13 +0000 Subject: [PATCH] Bug : display in read method doesn't function. It always display all the fields git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1262 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 :