i am developing a webpage with a table that's populated dynamically when the page is loaded. i have a delete/update buttons on each row of the table, but i cant figure out how to get the value (message id) of the selected table row so i can run the delete/edit script on the correct record.
this is the code that populates the table:
while ($row=mysqli_fetch_array($run_post)){
$post_date=$row['msg_post_date'];
$post_title=$row['msg_title'];
$post_id=$row['msg_id'];
$post_list[]=$row['msg_id'];
//table post date
echo "<td><div class='thumbnail-mar-less'>$post_date</div></td>";
//table title
echo "<td><div class='thumbnail-mar-less'><a href='#'>$post_title</a></div></td>";
//table buttons
echo "<td>
<form class='form-inline thumbnail-mar-less' role='form'>
<div class='form-group'><button class='btn btn-default btn-sm'>Edit Post</button></div>
<div class='form-group'><button name='delete'value=' ' class='btn btn-primary btn-sm'>Delete</button></div>
</div>
</td>";
echo "</tr>";
}
any suggestions on how i would assign and retrieve a value to each row???