From 2e2e0b67f00cafed857cc86953d9ade33f73cb08 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 10 Jul 2020 13:08:07 +0200 Subject: [PATCH] Fix appointment insertion in database --- src/appointment.php | 1 + src/database.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/appointment.php b/src/appointment.php index ba257f8..4e08580 100644 --- a/src/appointment.php +++ b/src/appointment.php @@ -63,6 +63,7 @@ + diff --git a/src/database.php b/src/database.php index ea08eeb..970735d 100644 --- a/src/database.php +++ b/src/database.php @@ -403,9 +403,7 @@ function fetchDoctorHolidays($pdo, $doctor) function createAppointment($pdo, $data){ $query = "INSERT INTO cita (fecha, hora, duracion, medico, observaciones, paciente) VALUES (?,?,?,?,?,?)"; - $result = $pdo->prepare($query); - $result->execute([$data["fecha"], $data["hora"], $data["duracion"], + $pdo->prepare($query)->execute([$data["fecha"], $data["hora"], $data["duracion"], $data["doctor"], $data["observaciones"], $data["paciente"]]); - $result->debugDumpParams(); return "Cita creada con éxito"; }