I want to have an ID being linked with the clicked result from my output but I want java script to get the link to avoid calling another page. My old way of coding is like this, I have cut the other info.
$id=$row["IndexNo"];
echo '
<tr>
<td>'. $row["IndexNo"] . '</td>
<td>'. $row["SurName"] . '</td>
<td>'. $row["FirstName"] .'</td>
<td><a href="update.php?IndexNo='. $id . '">view</a></td>
</tr>';
this way the page update.php is loaded with a URL:.../update.php?IndexNo=1. I want to avoid this page load by introducing java script like
$(document).ready(function(){
$("#update").click(function(){
$("#content").load("update.php");
});
});
the thing is I don't seem to know how to link the two on click of what I should put in the href but at the same time call the ID to only call a distinct result for that selected IndexNo.