summaryrefslogtreecommitdiff
path: root/php/Database.php
blob: 81ce66974c80968f5635745f32446ad411f5854c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
// php/Database.php

// connexion avec PDO_sqlite
try
{
    $db = new PDO('sqlite:' . $db_name . '.sqlite');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (Exception $e)
{
    die('Erreur : '.$e->getMessage());
}


// requêtes SQL
class SQL
{
    // créer les tables si elles n'existent pas encore
    static function create_tables()
    {
        //$db->exec("CREATE TABLE IF NOT EXISTS matable (ID INTEGER PRIMARY KEY, champ1 INTEGER, champ2 TEXT);");
        //
        //
    }
}