I am looping a DIV with foreach loop. my PHP looks like this:
<?php foreach ($record as $row) { //looping the records ?>
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<h4><?php echo get_userdetails_byid($row['user_id']); ?></h4>
</div>
</div>
<?php } ?>
And the modal always show the first entry of the loop.. however in the html source code i can see all the records. How do i trigger each result individually?