Demo of showing record details by using buttons in JQuery

IDNameMore
1John Deo
2Max Ruin
3Arnold
4Krish Star
5John Mike
6Alex John
7My John Rob
8Asruid
9Tes Qry
10Big John


HTML & PHP


<table >
<tr><td>ID</td><td>Name</td><td>More </td></tr>
<?Php
require "../../include/z_db1_demo.php"; // Database Connection 

$sql="SELECT id,name FROM student limit 0,10";
foreach ($dbo->query($sql) as $row) {
echo "<tr ><td>$row[id]</td><td>$row[name]</td><td><button value=$row[id] class='show_details'>Details</button></td></tr>";
}
echo "</table>";

?>

 <div id="my_dialog" title="plus2net  dialog">
  <div id=body></div>
</div>

JQuery


<script>
   $(document).ready(function() {
$(function() {
var pos = { my: "center center", at: "center top", of: window };
    $( "#my_dialog" ).dialog({
								autoOpen: false,
     position: pos,
buttons: {
        "Close ": function() {
          $( this ).dialog( "close" );
        }
      }

							});
});

$('.show_details').click(function() {
$( "#my_dialog" ).dialog( "open" );
$('#body').text('Wait..');
var id=$(this).attr("value");
$('#body').load("dialog-box7ck.php?id="+id);
})

})
</script>