<?
virtual
("header.shtml");
?>

<?
mysql_connect
( "localhost", "username", "passwd") or die( "Error connecting");

mysql_select_db( "mlug") or die( "Error opening database");



$result = mysql_query( "select max(id) from members");
$row = mysql_fetch_row($result);
$num = $row[0];
$num += 5;
echo
"<h1>Member Count: $num\n</h1>";        
?>

<table>
<tr>
<td>
<form method=post action="members.php3">
<select name="sort">
    <option value="last">Last Name
    <option value="first">First Name
    <option value="email">Email
</select>
<input type="submit" value="sort">
</form>
</td>
<td>
<form action="getemail.php3">
<input type="submit" value="edit your information">
</form>
</td></tr></table>
<?
if ($sort == "")
{
$sort = "last";
}


$result = mysql_query( "select first, last, email, id from members order
by $sort"
);
echo
"<table><form name=theid method=post action=moreinfo.php3>";
echo
"<tr><td bgcolor=#EDEDB9><b>First Name</b></td>
    <td bgcolor=#EDEDB9><b>Last Name</b></td>
    <td bgcolor=#EDEDB9><b>Email Name</b></td>
    <td bgcolor=#EDEDB9><b>More Info</b></td></tr>"
;
while (
$row = mysql_fetch_row($result))
    {
    echo
"<tr><td bgcolor=#999999>$row[0]</td>";
    echo
"<td bgcolor=#999999>$row[1]</td>";
    echo
"<td bgcolor=#999999>$row[2]</td>";
    echo
"<td bgcolor=#999999><form method=post
    action=moreinfo.php3><input type=hidden name=theid
        value=$row[3]><input type=submit
        value=info...></form></td></tr>"
;
    }

echo
"</table>";

?>


<?
virtual
("footer.shtml");
?>