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
This commit is contained in:
2014-03-26 19:58:13 +00:00
parent 15c8a41911
commit 7c2ea07315

View File

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