How to reduce the quantity of items in stock? – PHP – SitePoint Forums






                
Add Patient
=?,section-?,section) WHERE id=?"; $stmt = $db->prepare($sql); $stmt->execute([ $Impalnt_n, $Impalnt_n, $Implant_s ]); if($stmt->rowCount()) { // the section value was updated, i.e. section was >= $Impalnt_n echo 'update was successful'; }else{ // the section value was unchanged, i.e. section was < $Impalnt_n echo 'there was not sufficient quantity to update'; } $stm = $db->prepare("INSERT INTO patient (id,name , registration_d, birth, mobile, fixation_t, doctor, Impalnt_n, Implant_d, note1, g_former, note2, aboutment_d, note3, which_t, Implant_l, Size, Implant_s, type_of_c, note4, Cost, note5) VALUES (NULL, :name,:registration_d, :birth, :mobile, :fixation_t, :doctor, :Impalnt_n, :Implant_d, :note1, :g_former, :note2, :aboutment_d, :note3, :which_t, :Implant_l, :Size, :Implant_s, :type_of_c, :note4, :Cost, :note5);"); $stm->bindParam(":name", $name, PDO::PARAM_STR); $stm->bindParam(":registration_d", $registration_d, PDO::PARAM_STR); $stm->bindParam(":birth", $birth, PDO::PARAM_STR); $stm->bindParam(":mobile", $mobile, PDO::PARAM_STR); $stm->bindParam(":fixation_t", $fixation_t, PDO::PARAM_STR); $stm->bindParam(":doctor", $doctor, PDO::PARAM_STR); $stm->bindParam(":Impalnt_n", $Impalnt_n, PDO::PARAM_STR); $stm->bindParam(":Implant_d", $Implant_d, PDO::PARAM_STR); $stm->bindParam(":note1", $note1, PDO::PARAM_STR); $stm->bindParam(":g_former", $g_former, PDO::PARAM_STR); $stm->bindParam(":note2", $note2, PDO::PARAM_STR); $stm->bindParam(":aboutment_d", $aboutment_d, PDO::PARAM_STR); $stm->bindParam(":note3", $note3, PDO::PARAM_STR); $stm->bindParam(":which_t", $which_t, PDO::PARAM_STR); $stm->bindParam(":Implant_l", $Implant_l, PDO::PARAM_STR); $stm->bindParam(":Size", $Size, PDO::PARAM_STR); $stm->bindParam(":Implant_s", $Implant_s, PDO::PARAM_STR); $stm->bindParam(":type_of_c", $type_of_c, PDO::PARAM_STR); $stm->bindParam(":note4", $note4, PDO::PARAM_STR); $stm->bindParam(":Cost", $Cost, PDO::PARAM_STR); $stm->bindParam(":note5", $note5, PDO::PARAM_STR); $stm->execute(); re("success"," سوپاس ","قوتابی بەسەرکەوتویی زیادکرا. "); direct("./add_student.php"); // }else { // re("danger"," کێشە! "," تکایە خانەکان بە دروستی پڕبکەوە."); // } }else { re("danger"," کێشە! "," کێشەیەک ڕویدا تکایە دووبارە هەوڵ بدەوە."); } } ?>

James S. Joseph