Fix appointment insertion in database
This commit is contained in:
parent
3eab99b0f6
commit
2e2e0b67f0
|
@ -63,6 +63,7 @@
|
|||
<button class="create_btn" type="submit" name="create" >Añadir cita</button>
|
||||
<?php $doctor = fetchDoctor($pdo); ?>
|
||||
<input type="hidden" name="doctor" value="<?php echo $doctor; ?>">
|
||||
<input type="hidden" name="fecha" id="fecha">
|
||||
</form>
|
||||
<?php closeDatabase($pdo); ?>
|
||||
</div>
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue