This commit is contained in:
thaaoblues 2024-01-16 19:02:42 +01:00
parent 10255b0ce5
commit ea47fc9efe

11
bdd.php
View file

@ -56,7 +56,16 @@ function ajouter_doc($request){
$sql = "INSERT INTO ensembles (commentaire_auteur,corrige_inclu) VALUES(?,?)";
try{
$conn->execute_query($sql,array(htmlspecialchars($request['commentaire_auteur']),boolval($request["corrige_inclu"])));
$stm = $conn->prepare($sql);
echo "test1";
$request['commentaire_auteur'] = htmlspecialchars($request['commentaire_auteur']);
$request["corrige_inclu"] = boolval($request["corrige_inclu"]);
$stm->bind_param("si",$request['commentaire_auteur'],$request["corrige_inclu"]);
echo "test2";
$stm->execute();
echo "test3";
//$conn->execute_query($sql,array(htmlspecialchars($request['commentaire_auteur']),boolval($request["corrige_inclu"])));
saveFilesFromPost($request,mysqli_insert_id($conn));
}catch(Exception $e){
echo(json_encode(["status"=>"0","msg"=>$e->getMessage()]));