Not sure that it will work, but try this code:
<?php
$db = mysql_connect("localhost", "root", "mysqlonnow");
mysql_select_db("test",$db);
// display individual record
if ($_GET['id'])
{
$result = mysql_query("SELECT * FROM employees WHERE id='".$_GET['id']."'",$db);
$myrow = mysql_fetch_array($result,1);
printf("First name: %s\n<br>", $myrow['first']);
printf("Last name: %s\n<br>", $myrow['last']);
printf("Address: %s\n<br>", $myrow['address']);
printf("Position: %s\n<br>", $myrow['position']);
}
else
{
// show employee list
$result = mysql_query("SELECT * FROM employees",$db);
if (mysql_num_rows($result) > 0)
{
// display list if there are records to display
while($myrow = mysql_fetch_array($result,1))
{
printf("<a href=\"%s?id=%s\">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["first"], $myrow["last"]);
}
}
else
{
// no records to display
echo "Sorry, no records were found!";
}
}
?>