<HTML><HEAD>
<TITLE>Address Book Index</TITLE>
</HEAD><BODY>
<H1>Address Book Index</H1>
<UL>
<?php
// Connect to database.
$c = mysql_pconnect ( "localhost", "mylogin", "mypasswd")
|| die ( "Error connecting to database!" );
// Get each entry sorted by name.
$res = mysql_db_query ( "ADDRESS_BOOK",
"SELECT * FROM PERSON ORDER BY LAST_NAME, FIRST_NAME");
// Output result
while ($entry=mysql_fetch_array ($res))
{
printf ("<LI><A HREF=\"view.php3?id=%d\">%s,
%s</A>\n", $entry["ID"], $entry["LAST_NAME"],
$entry["FIRST_NAME"] );
}
// Free resources.
mysql_free_result ( $res );
?>
</UL>
<P><HR>
<A HREF="index.htm">Home Page</A>
</BODY>
</HTML>