PHP Foreach jquery button- Only One Row Firing -


i have php foreach statement works. have jquery button on 1 of echos. below associated jquery function. on page load first button fires , rest below don't. can help?

//include 'database.php';                $pdo2 = database::connect();                $sql2 = 'select * animals riderid = '.$data[id].'';                foreach ($pdo2->query($sql2) $row) {                         echo '<tr>';                         echo '<td>'. $row['hp'] . '</td>';                         echo '<td>'. $row['hpname'] . '</td>';                         echo '<td>'. $row['hpage'] . '</td>';                         echo '<td>'. $row['hpcolour'] . '</td>';                         echo '<td>'. $row['hpmicro'] . '</td>';                         echo '<td>';                         //echo '<a class="btn" href="read.php?id='.$row['id'].'">more info</a>';                         //echo ' ';                         echo '<a class="btn btn-success" href="update.php?id='.$row['id'].'">update</a>';                         echo ' ';                         echo '<button class="btn btn-danger" id="complexconfirm">delete record</button>';                         echo '</td>';                         echo '</tr>';                }                database::disconnect();               ?>                  </div>                  </tbody>                 </table>              <script>              $("#complexconfirm").confirm({             title:"are sure want delete <?php echo $data['hp1'];?> called <?php echo $data['hpname1'];?>?",             text: "please note record archived in case.",             confirm: function(button) {                 button.fadeout(2000).fadein(2000);                  $.ajax({                 url: 'deletehorse.php?id=<?php echo $id;?>&hp=hp1&hpname=hpname1&hpage=hpage1&hpcolour=hpcolour1&hpmicro=hpmicro1',                 success: function(){                 //alert('done');                 window.location.reload(true);             }             });               },             cancel: function(button) {                 button.fadeout(2000).fadein(2000);              },             confirmbutton: "yes am",             cancelbutton: "no"             });          </script> 

the buttons have same id, won't bind using javascript. try changing id class, , binding class instead.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -