diff --git a/SwichGIT/MorpionPhp/MaDB.php b/SwichGIT/MorpionPhp/MaDB.php index 58e90b3..d9cf9e7 100644 --- a/SwichGIT/MorpionPhp/MaDB.php +++ b/SwichGIT/MorpionPhp/MaDB.php @@ -4,6 +4,7 @@ class MyDB extends SQLite3 function __construct() { $this->open('mysqlitedb.db'); + $this->exec('CREATE TABLE partie(Id STRING,un STRING,deux STRING, trois STRING,quatre STRING,cinq STRING,six STRING,sept STRING,huit STRING,neuf STRING)'); } } @@ -27,3 +28,15 @@ function CreerPatie(string $bd,string $id){ function SupprimerLigne(string $bd,string $id){ $suppression = $bd->query('DELETE FROM partie where Id="'.$id.'" '); } +function Sup1h($datetime) +{ + $dateactuelles = date('h:i'); + $dateactuelle= new DateTime($dateactuelles); + $interval = $datetime->diff($dateactuelle); + echo $interval->format('%H');//00 years + if($interval>1){ + echo "supp"; + } +} +$datetime1 = new DateTime('12:55'); +Sup1h($datetime1); \ No newline at end of file