29 lines
642 B
PHP
29 lines
642 B
PHP
|
<?php
|
||
|
require 'bootstrap.php';
|
||
|
|
||
|
//*
|
||
|
// **** Table COMPTEUR ****
|
||
|
// *
|
||
|
$statement = <<<EOS
|
||
|
CREATE TABLE IF NOT EXISTS compteur (
|
||
|
id INT NOT NULL AUTO_INCREMENT,
|
||
|
libelle VARCHAR(255) NOT NULL,
|
||
|
PRIMARY KEY (id)
|
||
|
) ENGINE=INNODB;
|
||
|
|
||
|
INSERT INTO compteur
|
||
|
(id, libelle)
|
||
|
VALUES
|
||
|
(1, 'Garage général'),
|
||
|
(2, 'Cuisine d\'été, prise exterieure'),
|
||
|
(3, 'Compteur ENEDIS, Heures pleines'),
|
||
|
(4, 'Compteur ENEDIS, Heures creuses');
|
||
|
EOS;
|
||
|
|
||
|
try {
|
||
|
$createTable = $dbConnection->exec($statement);
|
||
|
echo "Success!\n";
|
||
|
} catch (\PDOException $e) {
|
||
|
exit($e->getMessage());
|
||
|
}
|