query("UPDATE `opd_follow_up` SET `Outcome`='$Outcome',`ReactionInvestigation`='$Investigation',`SpecifyInvestigation`='$Investigation_note',`ReactionTreatment`='$Medication',`SpecifyTreatment`='$Medication_note',`CreatedTime`='$CreatedTime',`UpdatedAt`='$Crated_At',`Status`='1' WHERE `prescriptionid`='$prescriptionid' AND `patientid`='$patientid'"); echo $sql; if($sql) { // Message for successfull insertion echo ""; echo ""; } else { // Message for unsuccessfull insertion echo ""; echo ""; } } if(isset($_POST['IPDFollowUp'])) { $prescriptionid=$_POST['prescriptionid']; $patientid=$_POST['patientid']; $hospital_id='0'; $surgery=$_POST['surgery']; $treatmentSurgeries=$_POST['treatmentSurgeries']; $Investigation=$_POST['Investigation']; $Investigation_note=$_POST['Investigation_note']; $Infection=$_POST['Infection']; $Infection_note=$_POST['Infection_note']; $Medication=$_POST['Medication']; $Medication_note=$_POST['Medication_note']; $Crated_At=date("F d, Y / h:i:s A"); date_default_timezone_set("Asia/Calcutta"); //India time (GMT+5:30) $CreatedTime= date('H:i:s'); $CreateDate= date('Y-m-d'); for ($i = 0; $i < count($_POST['surgery']); $i++) { $sql=$conn->query("INSERT INTO `ipd_follow_up`(`prescriptionid`, `patientid`, `hospital_id`, `surgery`, `treatmentSurgeries`, `Investigation`, `Investigation_note`, `Infection`, `Infection_note`, `Medication`, `Medication_note`, `Entered_By`, `CreatedTime`, `CreatedDate`, `CreatedAt`, `UpdatedAt`, `Status`) VALUES ('$prescriptionid','$patientid','$hospital_id','$surgery','$treatmentSurgeries','$Investigation','$Investigation_note','$Infection','$Infection_note','$Medication','$Medication_note','0','$CreatedTime','$CreateDate','$Crated_At','null','1')"); } //echo $sql; if($sql) { // Message for successfull insertion echo ""; echo ""; } else { // Message for unsuccessfull insertion echo ""; echo ""; } } ?>