From 1474dfbbdb05fb1844503375b6d50216f1c0e105 Mon Sep 17 00:00:00 2001 From: PeaceCopathe Date: Mon, 15 Apr 2013 23:31:01 +0200 Subject: [PATCH] correction bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Il vaut mieux initialiser pdo avant de tenter ce créer une table... --- inc/db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/db.php b/inc/db.php index 94777bb9c..a1674ea75 100644 --- a/inc/db.php +++ b/inc/db.php @@ -12,8 +12,8 @@ class db { var $handle; function __construct($path) { - $this->handle->exec('CREATE TABLE IF NOT EXISTS "entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , "title" VARCHAR, "url" VARCHAR UNIQUE , "is_read" INTEGER DEFAULT 0, "is_fav" INTEGER DEFAULT 0, "content" BLOB)'); $this->handle = new PDO($path); + $this->handle->exec('CREATE TABLE IF NOT EXISTS "entries" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , "title" VARCHAR, "url" VARCHAR UNIQUE , "is_read" INTEGER DEFAULT 0, "is_fav" INTEGER DEFAULT 0, "content" BLOB)'); $this->handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); }