Reputation: 181
How to show an individual record when onclick on the name "Alex".
<?php
echo "<table class='tableSection' border='1'><thead><tr><th><span class='tb_row2'>Referee</span></th><th><span class='tb_row2'>Date Referred</span></th><th><span class='tb_row2'>Status</span></th><th><span class='tb_row2'>Date Approved</span></th></tr></thead>";
$printlist_sql = "select a.Name, a.todate from table1 a left join admin_login b on a.StaffID = b.User_Id where b.Admin_Id ='userID' order by table_Id";
echo "<tbody>";
$referral_result = mysql_query($printlist_sql, $link);
while ($s_referral_row = mysql_fetch_array($referral_result))
{
echo "<tr><td class='tb_row2'>".$s_referral_row['Name']."</td>";
echo "<td class='tb_row2'>".$s_referral_row['todate']."</td>";
}
echo " </tbody>";
echo "</table>";
?>
My table:
Name Todate
Alex 2015-05-22
Alice 2015-05-22
Upvotes: 1
Views: 91
Reputation: 519
<?php
echo "<table class='tableSection' border='1'><thead><tr><th><span class='tb_row2'>Referee</span></th><th><span class='tb_row2'>Date Referred</span></th><th><span class='tb_row2'>Status</span></th><th><span class='tb_row2'>Date Approved</span></th></tr></thead>";
$printlist_sql = "select a.Name, a.todate from table1 a left join admin_login b on a.StaffID = b.User_Id where b.Admin_Id ='userID' order by table_Id";
echo "<tbody>";
$referral_result = mysql_query($printlist_sql, $link);
while ($s_referral_row = mysql_fetch_array($referral_result))
{
echo "<tr><td class='tb_row2'><a href="test.php">".$s_referral_row['Name']."</a></td>";
echo "<td class='tb_row2'>".$s_referral_row['todate']."</td>";
}
echo " </tbody>";
echo "</table>";
?>
Upvotes: 1