diff --git a/controleurs/cElement.php b/controleurs/cElement.php index f2c6ae8..56bcd85 100644 --- a/controleurs/cElement.php +++ b/controleurs/cElement.php @@ -1,5 +1,4 @@ - \ No newline at end of file diff --git a/db/cuisine.db b/db/cuisine.db index 876a775..f78001e 100644 Binary files a/db/cuisine.db and b/db/cuisine.db differ diff --git a/inc/modele.php b/inc/modele.php index c726311..dc03234 100644 --- a/inc/modele.php +++ b/inc/modele.php @@ -5,7 +5,7 @@ function getDB() {return new SQLite3("db/cuisine.db");} function getAssocFromQueryString($qs){ $db = getDB(); $stmt = $db->prepare($qs); - $result = $stmt->execute(); + $result = $stmt ? $stmt->execute() : false; $assocArray = []; while ($ligne = $result->fetchArray(SQLITE3_ASSOC)){ $assocArray[] = $ligne; @@ -185,6 +185,12 @@ function safePutUnite($nom){ return $db->exec($requete); } +function getElementWithElementId($idElement, $table){ + $requeteId = "SELECT * FROM $table WHERE id=$idElement;"; + $resultat = getAssocFromQueryString($requeteId); + return ($resultat ? $resultat[0] : false); +} + // modification vaut false si on effectue une création de recette et l'id de la recette à modifier sinon // les listes d'ingrédients, de préparation et d'ustensile sont des tableaux de tableaux indexés sur les id des éléments utilisés. function insererRecette($infosRecette, $listeIngredients, $listeUstensile, $listePreparation, $listeReutilise, $modification){ diff --git a/static/entete.php b/static/entete.php index 74fddee..7e9ad49 100644 --- a/static/entete.php +++ b/static/entete.php @@ -2,4 +2,5 @@
Attention, ce site est en cours de refonte totale, il ne devrait pas être en production !
\ No newline at end of file