1

I am creating a updating form page. it shows no error but there is no updation in my database. I already check whole the database row names but that doesnt help. that code is a little bit long but please help.

   <?php
    if (isset($_POST['update'])) {

    $update_id = $_GET['edit_form'];
    $bill = $_POST['b_no'];
    $naam = $_POST['name'];
    $mobile_no = $_POST['mobile'];
    $addres = $_POST['add'];
    $detail = $_POST['p_detail'];

    $p_img_name = $_FILES['p_img']['name'];
    $p_img_type = $_FILES['p_img']['type'];
    $p_img_size = $_FILES['p_img']['size'];
    $p_img_tmp = $_FILES['p_img']['tmp_name'];

    $prc = $_POST['price'];
    $deposite = $_POST['d_amt'];
    $remaning = $_POST['r_amt'];

    $b_img_name = $_FILES['b_img']['name'];
    $b_img_type = $_FILES['b_img']['type'];
    $b_img_size = $_FILES['b_img']['size'];
    $b_img_tmp = $_FILES['b_img']['tmp_name'];

    $p_date = date('y-m-d');

    move_uploaded_file($p_img_tmp, "images/Product/$p_img_name");
    move_uploaded_file($b_img_tmp, "images/Bill/$b_img_name");

    $update_query = "UPDATE new_entry SET bill_no='$bill', name='$naam', 
    mobile_no='$mobile_no', address='$addres', product_detail='detail', 
    product_image='$p_img_name', price='$prc', deposite_amt='deposite', 
    remaining='$remaning', bill_image='$b_img_name',Product_date='$p_date' 
    WHERE s_no='$update_id' ";

    if(mysqli_query($conn, $update_query)) {

        echo "<script> alert('Entry Updated Successfully') </script>";
        echo "<script> window.open('view_entry.php','_self') </script>";
                } else {
                    echo "cant Update Entry.." .mysqli_error($conn);
                }

  } 

  ?>
Mohit Soni
  • 35
  • 1
  • 1
  • 6

0 Answers0