
Listing 7:  User listing section of reporting script

	# Connect to the database
	$dbh=DBI->connect( "DBI:Pg:dbname=$dbName;
host=$dbHost", $dbUser, $dbPassword )
		|| die "Unable to connect: $DBI::errstr\n";

	# Populate the username list from the database
	$query_ref=$dbh->selectcol_arrayref("select DISTINCT username from traffic")
		|| die "Failed database lookup: $DBI::errstr\n";
	@userlist=@$query_ref;

	# Add "---Everyone---" to the top of the user list
	unshift @userlist, '---Everyone---'


