= (int)$minPoids; } } return false; } function updateEventTitle($bdd, $eventid, $titre){ $stmt = mysqli_prepare( $bdd, "UPDATE evenements SET titre = ? WHERE id = ?" ); mysqli_stmt_bind_param($stmt, "si", $titre, $eventid); mysqli_stmt_execute($stmt); $success = mysqli_stmt_affected_rows($stmt) >= 0; mysqli_stmt_close($stmt); return $success; } function updateEventImage($bdd, $eventId, $newFileName){ $stmt = mysqli_prepare( $bdd, "UPDATE evenements SET couverture = ? WHERE id = ?" ); mysqli_stmt_bind_param($stmt, "si", $newFileName, $eventId); mysqli_stmt_execute($stmt); $success = mysqli_stmt_affected_rows($stmt) >= 0; mysqli_stmt_close($stmt); return $success; } function getSpecificActus($bdd, $id) { $results = mysqli_query($bdd, "SELECT * FROM `actus` WHERE `id`=" . $id); $return = []; while ($row = mysqli_fetch_assoc($results)) { $return[] = $row; } return $return; } function updateActuImage($bdd, $actuId, $newFileName){ $stmt = mysqli_prepare( $bdd, "UPDATE actus SET image = ? WHERE id = ?" ); mysqli_stmt_bind_param($stmt, "si", $newFileName, $actuId); mysqli_stmt_execute($stmt); $success = mysqli_stmt_affected_rows($stmt) >= 0; mysqli_stmt_close($stmt); return $success; } function updateActuTitle($bdd, $actuId, $titre){ $stmt = mysqli_prepare( $bdd, "UPDATE actus SET titre = ? WHERE id = ?" ); mysqli_stmt_bind_param($stmt, "si", $titre, $actuId); mysqli_stmt_execute($stmt); $success = mysqli_stmt_affected_rows($stmt) >= 0; mysqli_stmt_close($stmt); return $success; } function updateActuContent($bdd, $actuId, $content){ $stmt = mysqli_prepare( $bdd, "UPDATE actus SET actu = ? WHERE id = ?" ); mysqli_stmt_bind_param($stmt, "si", $content, $actuId); mysqli_stmt_execute($stmt); $success = mysqli_stmt_affected_rows($stmt) >= 0; mysqli_stmt_close($stmt); return $success; } function createEvent($bdd, $titre, $date, $site){ $sql = "INSERT INTO evenements (date, titre, couverture, site_id) VALUES (?, ?, '', ?)"; $req = $bdd->prepare($sql); $req->bind_param("ssi", $date, $titre, $site); $req->execute(); return $bdd->insert_id; }