diff --git a/dblayer.php b/dblayer.php index 7a01582..8851b68 100644 --- a/dblayer.php +++ b/dblayer.php @@ -85,6 +85,14 @@ class dblayer extends PDO { throw new Exception ("PDO error : ".$e->getMessage()); } + + // Force specifics initialisations + switch ($this->db->getAttribute(PDO::ATTR_DRIVER_NAME)) + { + case "sqlite": + // Force ForeignKeys support (disabled by default) + $this->db->exec("PRAGMA foreign_keys = ON"); + } } /** Create a new entry in the table. Datas must be an indexed array @@ -331,7 +339,9 @@ class dblayer extends PDO } else { - if (!array_key_exists ($columns, $datasOK)) continue; + // FIXME ! Problem if $datasOK contains primary / else can be warned on + // $datasOK[$columns] if it doesn't exists + if (array_key_exists ($columns, $datasOK)) continue; $select = array (); if ($columns !== $this->primary) $select[] = array ($this->primary, $updatekey, "!=");