表は更新されているように見えますが、メイン ページにリダイレクトされません。私は運が悪いので、さまざまなことを試しました。誰かが私を助けることができれば。よろしくお願いします。ページの完全なコードを配置する必要がある場合は、更新コードのみを配置します。
$id_actividades = $_GET['idactividades'];
include('../includes/eamoschema.php');
$stmt = $dbh->prepare("SELECT * FROM actividades WHERE idactividades=:id_actividades");
$stmt -> bindParam(':id_actividades', $id_actividades);
$stmt->execute();
$result = $stmt->fetchall(PDO::FETCH_ASSOC);
if($_SERVER['REQUEST_METHOD']== 'POST'){
if (isset($_POST['tname']) || isset($_POST['place']) || isset($_POST['organizer']) || isset($_POST['from']) || isset($_POST['to']) ) {
$tname = $_POST['tname'];
$place = $_POST['place'];
$organizer = $_POST['organizer'];
$from = $_POST['from'];
$to = $_POST['to'];
try{
$stmt = $dbh->prepare("UPDATE guaynabodb.actividades SET ntorneo = :n_torneo, ltorneo = :l_torneo, otorneo = :o_torneo, fecha_inicial = :from, fecha_final = :to WHERE idactividades=:id_actividades");
$stmt -> bindParam(':n_torneo', $tname);
$stmt -> bindParam(':l_torneo', $place);
$stmt -> bindParam(':o_torneo', $organizer);
$stmt -> bindParam(':from', $from);
$stmt -> bindParam(':to', $to);
$stmt -> bindParam(':id_actividades', $id_actividades);
$stmt->execute();
}
catch (PDOException $ex) {
$_SESSION['errorCode3'] =$ex->getMessage();
header('Location: actividades.php?errorCode=3');//To redirect
exit;
}
header('Location:actividades.php');//To redirect
exit;
}
}