<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE>
	Student Homepages
  </TITLE>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 </HEAD>
 <BODY>
 <h1 ALIGN="center">Student Homepages</h1>

<?

@$d = mysql_connect('localhost','database_username','database_password') or  
	die("<p>We can't process your request at this time.</p>");

@mysql_select_db('exams') OR die ("<p>We can't process your request at this time.</p>");

// Insert data
$last = "raymond"; $first_middle = "garrett"; 
$url = "http://www.deathtothemidgets.com";
$q = "insert into exam2 values ('$last','$first_middle','$url',now())";
@$r = mysql_query($q) OR die ("<p>We can't process your request at this time.</p>");

$last = "bronke"; $first_middle = "david H."; 
$url = "http://whitelynx.g33xnexus.com";
$q = "insert into exam2 values ('$last','$first_middle','$url',now())";
@$r = mysql_query($q) OR die ("<p>We can't process your request at this time.</p>");

$last = "Case"; $first_middle = "christopher S."; 
$url = "http://www.gne.g33xnexus.com/precursors/";
$q = "insert into exam2 values ('$last','$first_middle','$url',now())";
@$r = mysql_query($q) OR die ("<p>We can't process your request at this time.</p>");

$last = "ross"; $first_middle = "Sarah"; 
$url = "http://www.minorlooneytunes.com";
$q = "insert into exam2 values ('$last','$first_middle','$url',now())";
@$r = mysql_query($q) OR die ("<p>We can't process your request at this time.</p>");

// Display Records
@$q = "select * from exam2 order by lower(last), lower(first_middle)"; 
@$r = mysql_query($q) OR die ("<p>We can't process your request at this time.</p>");

echo "<center><table width='60%'><tr><td><ol>\n";

while (@$row = mysql_fetch_row($r)) // Could use also $row = mysql_fetch_array($r)
{
	echo "<li><a href='$row[2]'>".ucwords(strtolower($row[1]))." ".ucwords(strtolower($row[0]))."</a>";
	echo "(<I>Created on $row[3]</I>)</li>\n";
}
echo "</ol></td></tr></table>\n";

mysql_free_result($r);

@mysql_close($d) OR die();
?>
</center></body></html>
