i have this code bellow , i have first table which i get its data by while loop. and i have one row in this table which is 'More Details' with every line button of 'Details' . i have tried this code of jquery but it works only with the first button , say that i have 10 lines in table with 10 buttons of course , so only the firt button works and show the 'table2' , but the other buttons dont work . i have think that maybe i can pass a variable to jquery which determine on which button user have clicked to show the table2 which is relativ with this button. i have googled this but google make me down , no result. any help would be very appreciated.
<script src="http://code.jquery.com/jquery-latest.js"></script>
<?php
$sql3= mysql_query("SELECT * FROM data ");
while($row3 =mysql_fetch_array($sql3)){
?>
<script>
$(document).ready(function() {
$('#showr').click(function(){
$('#Table2').show();
});
});
</script>
<table width='100%' border='1' cellspacing='0' cellpadding='0'>
<th>Weeks</th>
<th>date</th>
<th>place</th>
<th>More Details</th>
<tr>
<?php
echo "<tr ><td style= 'text-align : center ;'>my rows1</td>" ;
echo "<td style= 'text-align : center ;'>myrows2</td>";
echo "<td style= 'text-align : center ;'> myrows3</td>";
echo "<td style= 'text-align : center ;'><button id='showr'>More Details</button></td></tr>";
}
?>
</tr>
</table><br />
<div id= "Table2" style= "display:none;">
<table width='100%' border='1' cellspacing='0' cellpadding='0'>
<th>try</th>
<th>try2</th>
<tr>
<td>try3</td>
<td>trs</td>
</tr>
</table>
</div>