dynamic row values wrongly updated into mysql php

后端 未结 4 1840
长发绾君心
长发绾君心 2021-01-27 10:58

Here i\'m trying to edit & update my dynamic row values using php. This is my edit.php page coding. it fetch the dynamic row datas from mysql perfectly..

$ui         


        
4条回答
  •  生来不讨喜
    2021-01-27 11:16

    As per your comment: for example if user want to edit a voucher. in that voucher already contains 5 rows. user can edit their row values and if they want add two more rows... then try this.

    first delete the old data and then insert new one.

    $deletequery  = "delete from `ebvouchertariffs` WHERE VoucherID_Fk = '$uid' ";
    

    and then insert new data.

     foreach( $_POST['slno'] as $key=>$slno ) {
       $insertquery  = "insert into `ebvouchertariffs`.......";
     }
    

提交回复
热议问题