<?php
	// Database Query to create author list
	$author_drop="select authorname from book order by authorname asc";
	$author_drop_result=query_db($author_drop);
	// Error checking of query
	if(!$author_drop_result) error_message(sql_error());
	// Gets value for the loop from count query
	list($ad_count)=mysql_fetch_row($imagecount);

	// This loop used to create menu listing
	for($drop_count=0;$drop_count<$ad_count;$drop_count++)
	{
		list($author)=mysql_fetch_row($author_drop_result);
		// Checking for same author as already loaded
		if($author1 == $author)
		{
			// Sets author check variable
			$author1 = $author;
		}
		else
		{
			// Set the option field in menu
			echo "<option value = \"$author\">$author</option>";
			// Sets author check variable
			$author1 = $author;
		}
	}
?>
	
