javascript – update records of dynamic add and delete rows using php?

exception or error:

I want to update the record of dynamic add and delete rows. These rows add data into database with new line and id. The Primary Key is incremental, the other user ID is static, i want to fetch all the rows data and show it into the input fields respectively. whenever i try to fetch data from database, it just fetch first row data with the ID, and not the other rows data with the same ID. Need your kind attention towards this query please help me for the correct code

$Sql3 = "SELECT * FROM tbl_professional_certification WHERE apli_reg_no = '$id';";
$result1 = mysqli_query($conn, $Sql3);
$row5 = mysqli_fetch_array($result1, MYSQLI_ASSOC);
$count5 = mysqli_num_rows($result1);

for($i = 0; $i< $count5; $i++)

   echo $certificate_title[$i] = $row5['certificate_title'];
    $certificate_file[$i] = $row5['certificate_file'];

$(document).ready(function() {
  var i = 1;
  $("#Add_CERT").click(function() {
    $('#CERT' + i).html("<td>" + (i + 1) + "</td><td><input name='CERTName[" + i + "]' type='text' placeholder='e.g. PMP, MCPS, CCNA, CCNP etc.' class='form-control input-md'  /> </td><td><input type='file' name='CERT_File[" + i + "]'  class='form-control input-md'></td>");

    $('#Tab_CERT').append('<tr id="CERT' + (i + 1) + '"></tr>');
  $("#Delete_CERT").click(function() {
    if (i > 1) {
      $("#CERT" + (i - 1)).html('');

<script src=""></script>
<div class="col-md-12">
    <b>Have You Acquired Any Professional Certification?</b> <span style="color: red">*</span>

  <select class="form-control show-tick form-group form-float" name="ProfessionalCertificate" id="ProfessionalCertificate" required>
    <option selected disabled>Select Option</option>
    <option id="Yes1" value="Yes">Yes</option>
    <option id="No1" value="No">No</option>

<div class="col-md-12 Yes box5">
    <b>Please Upload</b>
  <div class="form-group form-float">
    <table class="table table-bordered table-hover" id="Tab_CERT">
          <th>Certification Name</th>
          <th>Attach Certificate</th>

        <tr id='CERT0'>
            <input type="text" name='CERTName[0]' placeholder='e.g. PMP, MCPS, CCNA, CCNP etc.' class="form-control" />

            <input type="file" name="CERT_File[0]" class="form-control" />

        <tr id='CERT1'></tr>
  <a id="Add_CERT" class="btn btn-default pull-left">Add Row</a><a id='Delete_CERT' class="pull-right btn btn-default">Delete Row</a>
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *