I have data I'm displaying in a table, using bootstrap. For each of those I'm wanting to do a modal, on this you would confirm you want to send an email.
This is the link they would click:
<a data-toggle="modal" data-target="#email-'.$row['id'].'">Resend Email</a>
The modal is on another page, and I've included this within the while for the MYSQL data using:
On this page I then load the modal using:
<div id="email-<?php echo $row['id'];?>" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Modal Header</h4> </div> <div class="modal-body"> <p><?php echo $row['number_tenants']; echo $row['full_name_one'];?></p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>
For each of the buttons that load you can click them and it will open a modal, the problem is it only ever shows data from the very first row, am I doing something wrong, or is there a better way to do this?