summaryrefslogtreecommitdiff
path: root/php/Database.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-11-27 02:34:34 +0100
committerpolo <ordipolo@gmx.fr>2022-11-27 02:34:34 +0100
commita2fdd37ffb5a3cc80b6fedb332024057553148f8 (patch)
treecb28a5ddb1a2dd520ba1c2e41dfea942b15dc17e /php/Database.php
parentefe371fd6e883dde99ca6d90a7aae99eb4aeadea (diff)
downloadAppliGestionPHP-a2fdd37ffb5a3cc80b6fedb332024057553148f8.zip
connexion BDD orientée objet
Diffstat (limited to 'php/Database.php')
-rw-r--r--php/Database.php26
1 files changed, 0 insertions, 26 deletions
diff --git a/php/Database.php b/php/Database.php
deleted file mode 100644
index 81ce669..0000000
--- a/php/Database.php
+++ /dev/null
@@ -1,26 +0,0 @@
1<?php
2// php/Database.php
3
4// connexion avec PDO_sqlite
5try
6{
7 $db = new PDO('sqlite:' . $db_name . '.sqlite');
8 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
9}
10catch (Exception $e)
11{
12 die('Erreur : '.$e->getMessage());
13}
14
15
16// requêtes SQL
17class SQL
18{
19 // créer les tables si elles n'existent pas encore
20 static function create_tables()
21 {
22 //$db->exec("CREATE TABLE IF NOT EXISTS matable (ID INTEGER PRIMARY KEY, champ1 INTEGER, champ2 TEXT);");
23 //
24 //
25 }
26}