I am perfoming PHP CRUD operations on a table. When i click the edit button rather then taking it to a new page i want to show the values in a modal. I want the value's to be displayed in the modal's form. I have created a modal but i am unable to think of an logic to pass the values of the row in which the edit button was clicked. Any help would be highly appreciated.
Create a page name ajax_modal_edit.php (If you are looking to change this page name. Change in <script></script> tag too. Both are related.)
$teacherid = $_GET['teacherid'];
// Use this `$teacherid` in query to get all required/appropriate field
<button type="button" class="close" data-dismiss="modal">×</button>
<h5 class="modal-title">Add Teacher <?php echo $teacherid;?></h5>
<form action="" method="POST">
Asked in February 2016Viewed 2,738 timesVoted 11Answered 1 times