You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
455 B
14 lines
455 B
<?php
|
|
$dbFile = __DIR__ . "/todo.sqlite";
|
|
$db = new PDO("sqlite:".$dbFile);
|
|
//Nastavení pro vyhazování vyjímek při chybách
|
|
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
|
|
//vytvoření tabulky pokud neexistuje
|
|
$query = "CREATE TABLE IF NOT EXISTS tasks(
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
task_text TEXT NOT NULL,
|
|
is_completed INTEGER DEFAULT 0,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
)";
|
|
$db->exec($query);
|
|
?>
|