I already have a table that shows only one data, after clicking a button(edit) i need it to show/display the other data from the database through modal. My problem is(for now), i cant fetch the ID for each row in the html table. (once i can get the ID i think i can fetch the other datas)
Heres the PHP Code that show the table:
<?php
$connection = mysql_connect('localhost', 'root', ''); //The Blank string is the password
mysql_select_db('ts_php');
$query = "SELECT * FROM job_posted";
$result = mysql_query($query);
echo "<table class='table'>
<thead>
<th>JOB</th>
<th>STATUS</th>
<th>APPLICATIONS</th>
<th>EDIT</th>
<th>DELETE</th>
</thead>"; // start a table tag in the HTML
while($row = mysql_fetch_array($result)){ //Creates a loop to loop through results
echo "<tr>
<th>" . $row['job_title'] . "</th>
<td>" . $row['status'] . "</td>
<td>" . $row['applications'] . "</td>
<td><a data-toggle='modal' data-target='#myModal'>edit</a></td>
<td><a href='#'>delete</a></td>
</tr>";
}
echo "</table>";
mysql_close();
?>