First commit

This commit is contained in:
2025-09-11 11:25:49 +02:00
commit 2a1804109b
19 changed files with 256 additions and 0 deletions

19
modele/categories.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
// Récupération des catégories
function getCategories() {
include("../donnees/connexion.php");
$stmt = $db->query("SELECT * FROM categories");
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
// Ajout d'une catégorie
function addCategorie() {
include("../donnees/connexion.php");
if (!empty($_POST['nom'])) {
$stmt = $db->prepare("INSERT INTO categories (nom) VALUES (?)");
$stmt->execute([$_POST['nom']]);
}
}
?>