Hi I'm a super begginer in web developing. I need to take my table ID to a modal in order to delete the mySQL record. This is my code:
<?php while($llenartabla = $getsibella->fetch_assoc()) { ?>
<tr>
<th scope="row"><?=$llenartabla['id']?></th>
<td><?=$llenartabla['date']?></td>
<td><?=$llenartabla['location']?></td>
<td><?=$llenartabla['city']?></td>
<td><button type="button" class="btn btn-danger" data-toggle="modal" data-target="#myModal">Delete</button></td>
</tr>
<?php }?>
And here is my code for the modal:
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Delete</h4>
</div>
<div class="modal-body">
Are you sure you want to delete the event?
</div>
<div class="modal-footer">
<a href="delete.php?id='I NEED THE ID HERE'" class="btn btn-danger">Delete</a>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
I know it's kind of an easy question, but I'm learning bootstrap and php haha. So any answers or comments are welcome :p
</div>