This repository has been archived on 2022-10-26. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
biblio/ajouterLivre.php
2019-02-11 10:24:07 +01:00

22 lines
No EOL
605 B
PHP

<?php
require_once "includes/bdd.php";
// Requête SQL ajout livre
$ajouterLivre = $bdd->prepare("INSERT INTO biblio_livre VALUES (:ISBN, :titre, :auteur, :genre, :parution, :mc, :stock, :editeur, :collection, :nbPages)");
// Tableau informations livre
$infosLivre = [];
// Stockage des infos dans tableau
foreach($_POST as $key => $value){
$infosLivre[$key] = $value;
}
// Exécution de la requête
$ajouterLivre->execute($infosLivre);
?>
<script type="text/javascript">
// Redirection vers le nouveau livre
window.location.href = 'livre.php?ISBN=<?= $infosLivre['ISBN'] ?>';
</script>