如何在php中使用超链接显示数据[关闭]

I already display a list of names in a hyperlink format. When I click on one of the names, it does not display the data related to the name clicked. Can anyone help me..

<?php echo '<a href="nama.php?ID='.$rekod['nama'].'">'.$rekod['nama'].'</a>'; ?>

this code for student.php page

<?php     
   if(isset($_GET[$rekod['nama']]))
                {
                        $id = $_GET[$rekod['nama']];
                    if( $id!= NULL)
                    {
                        $query="SELECT matrik, kp_pass, nama, kod_prog, status
                            FROM _pelajar
                            WHERE nama = '$id'";
                        $qr=mysql_query($query);
        ?>

-this code for student.php page

It looks like you're almost there; you're just looking for the wrong variables:

if (isset($_GET['ID'])) {
    $id = $_GET['ID'];                     
    if( $id!= NULL) {
    ....

You're passing the variable in as ID, so you need to look for that in $_GET.