// Define function to run single-row query and return response
FUNCTION qry ($sql) {
global $database,$db;
$rc = mysql_db_query($database,$sql,$db);
$row = mysql_fetch_array($rc);
$rtn = $row[0];
RETURN $rtn;
}
// Login to database
$hostname="db30.pair.com";
$username = "wyattr_r";
$password = "Elliread23";
$db = mysql_connect($hostname,$username,$password);
$database="wyattr_ellison";
?>
Harlan Ellison Bibliographical Database
This database will let you run customizable queries over Harlan Ellison's body
of work. The following queries are currently available:
Book Query - List books HE has written or edited.
Piece Query - List HE's individual works.
Comments and suggestions, especially
things you would like to see and mistakes you find, are most welcome. I've even
got a page of missing/wanted items.
Sources and Acknowledgements
Presently in the database are:
$rc = qry("SELECT COUNT(book_id) FROM bib_book");
echo "$rc books (";
$rc = qry("SELECT COUNT(book_id) FROM bib_book WHERE role='Writer' ");
echo "$rc written by HE and ";
$rc = qry("SELECT COUNT(book_id) FROM bib_book WHERE role='Editor' ");
echo "$rc edited by HE)
";
Echo "Book Breakdown: ";
$sql = "SELECT type, COUNT(book_id) FROM bib_book GROUP BY type";
$rc = mysql_db_query($database,$sql,$db);
WHILE ($row = mysql_fetch_array($rc)) {
echo "$row[0]=$row[1]   ";
}
echo "
";
$rc = qry("SELECT COUNT(piece_id) FROM bib_piece WHERE Type <> 'Break'");
echo "$rc pieces of work (";
$rc = qry("SELECT COUNT(piece_id) FROM bib_piece WHERE by_he='1' AND Type <> 'Break'");
echo "$rc by HE and ";
$rc = qry("SELECT COUNT(piece_id) FROM bib_piece WHERE by_he='0' AND Type <> 'Break'");
echo "$rc by others)
";
Echo "Piece Breakdown by HE: ";
$sql = "SELECT subType, COUNT(piece_id) FROM bib_piece WHERE by_he = '1' AND Type <> 'Break' GROUP BY subType";
$rc = mysql_db_query($database,$sql,$db);
WHILE ($row = mysql_fetch_array($rc)) {
echo "$row[0]=$row[1]   ";
}
Echo "
Piece Breakdown by Others: ";
$sql = "SELECT subType, COUNT(piece_id) FROM bib_piece WHERE by_he = '0' AND Type <> 'Break' GROUP BY subType";
$rc = mysql_db_query($database,$sql,$db);
WHILE ($row = mysql_fetch_array($rc)) {
echo "$row[0]=$row[1]   ";
}
echo "
";
echo "32 Pink hearts, 7 yellow moons, 15 orange stars, 4 green clovers, and 1 blue diamond (but no,
thank god, purple horseshoes).
";
$rc = qry("SELECT COUNT(book_id) FROM bib_edition");
echo "$rc book editions and ";
$rc = qry("SELECT COUNT(piece_id) FROM bib_book_piece");
echo "$rc book piece entries.";
echo "
";
?>
Other Fun Stuff:
HE Comic Bibliography, v6, by Chris
Day
See My HE Collection (71k JPG)
Future additions of the database may include:
URL links to book and piece reviews
Addition of piece synopses with search
Ability to add comments to pieces and vote on favorite books and pieces
Threaded message base at book and piece level
//end page
INCLUDE("html_end.htm");
exit;
?>