ok
Direktori : /home/keydecors/www/admin/controller/ |
Current File : /home/keydecors/www/admin/controller/vaccine_update.php |
<?php //include database configuration file include("../model/dboperation.php"); $ids = mysqli_real_escape_string($mysqli, $_POST['ids']); $vaccine_name = mysqli_real_escape_string($mysqli , $_POST['vaccine_name']); $vaccine_details = mysqli_real_escape_string($mysqli , $_POST['vaccine_details']); if(!empty($_FILES['img1']['tmp_name'])) { $temp1 = explode(".",$_FILES["img1"]["name"]); $newfilename1 = rand(). "_".date('m-d-Y_hia') . '.' .end($temp1); move_uploaded_file($_FILES['img1']['tmp_name'],"../vaccine_img/".$newfilename1); $img1=$newfilename1; $sql = "UPDATE vaccine SET vaccine_name = '$vaccine_name', vaccine_details = '$vaccine_details', img = '$img1' WHERE ids='$ids'"; } else { $sql = "UPDATE vaccine SET vaccine_name = '$vaccine_name', vaccine_details = '$vaccine_details' WHERE ids='$ids'"; } if (!mysqli_query($mysqli,$sql)) { die('Error: ' . mysqli_error($mysqli)); } header("location:../pages/vaccine_kart_update.php?pro=$ids");