function makeTreatmentsOfAppointment($con) { $sqlLatest = "SELECT max(ID) FROM appointments"; $appointmentID = pushQueryToArray($con, $sqlLatest); foreach ($_SESSION['chosenTreatments'] as $treatment) { $sql = "INSERT INTO appointments_has_treatments (appointments_ID, treatments_ID) VALUES (" . $appointmentID[0]['max(ID)'] . "," . $treatment . ")"; mysqli_query($con, $sql); } unsetAppointmentSessionVars(); redirectToHome(); }
<?php /** * Created by PhpStorm. * User: 1307811 * Date: 09/11/2015 * Time: 16:43 */ require_once "resources/config.php"; require_once LIBRARY_PATH . "/functions.php"; redirectToHome();