diff --git a/dblayer.php b/dblayer.php index 291b01f..2afa153 100644 --- a/dblayer.php +++ b/dblayer.php @@ -115,6 +115,14 @@ class dblayer extends PDO // Force ForeignKeys support (disabled by default) $this->db->exec("PRAGMA foreign_keys = ON"); break; + case "mysql": + // Set the coding to UTF8 + $this->db->exec("SET CHARACTER SET utf8"); + break; + case "pgsql": + // Set the coding to UTF8 + $this->db->exec("SET CHARACTER SET utf8"); + break; } $this->dsn = $dsn; } @@ -354,7 +362,7 @@ class dblayer extends PDO $value = md5 ($value); }); $req = "INSERT INTO `$this->tableprefix$this->table` "; - $req .= "(\"".implode ("\",\"", array_keys ($datasOK))."\")"; + $req .= "(`".implode ("`,`", array_keys ($datasOK))."`)"; $req .= " VALUES "; $req .= "(:".implode (",:", $binds).")"; if ($this->debug) echo "DEBUG : $req\n";