Harlan Ellison Piece Query


Piece List: Sort pieces by   Break list by
Show: > Piece notes   > First appearance > Collected flag
> Show books where piece appears   > Blank line between pieces
Select titles/notes containing: and piece type


" ") $sql .= " AND (title LIKE '%$search%' OR notes LIKE '%$search%')"; IF ($type <> "All") $sql .= " AND subType = '$type'"; ELSE $sql .= " AND Type<>'Break'"; $sql .= " ORDER BY "; IF ($break == "type") $sql .= "Type DESC,"; IF ($sort == "title") $sql .= "alpha_title"; ELSE { IF ($sort == "type") $sql .= "subType, alpha_title"; ELSE $sql .= "first_pub, title"; } echo $sql; $rc = mysql_db_query($database,$sql,$db); if(!$rc OR mysql_num_rows($rc) == 0) { ?> Sorry, no entries were found matching the criteria you selected. Come again! $numrows pieces selected:
"; // Read through titles selected $story_hdr = "N"; $essay_hdr = "N"; while ($row = mysql_fetch_array($rc)) { // check for type headers IF ($break=="type") { IF ($row[Type]=="Story" && $story_hdr!="Y") { $story_hdr = "Y"; echo "

Harlan Ellison: Stories

\n"; } IF ($row[Type]=="Essay" && $essay_hdr!="Y") { $essay_hdr = "Y"; echo "

Harlan Ellison: Essays

\n"; } } echo "$row[title]     - $row[subType], $row[first_pub]"; IF ($show_pc_coll) { ECHO " Collected: "; IF ($row[collected]) echo "Yes"; ELSE echo "No"; } echo "
\n"; IF ($show_pc_first && $row[first_appearance]>" ") echo "First Appearance: $row[first_appearance]
\n"; IF ($show_pc_notes && $row[notes]>" ") echo "  $row[notes]
\n"; // Read books if specified IF ($show_books) { $sql = "SELECT * from bib_book,bib_book_piece WHERE piece_id=$row[piece_id] "; $sql .= "AND bib_book.book_id=bib_book_piece.book_id ORDER by year_pub"; $rc2 = mysql_db_query($database,$sql,$db); IF (mysql_num_rows($rc2)) echo "Books where piece appears:
\n"; while ($row2 = mysql_fetch_array($rc2)) { echo "  $row2[title] - $row2[type], $row2[year_pub]
\n"; } } // end of read loop on pieces if ($line_break) echo "
"; } //end page INCLUDE("html_end.htm"); exit; ?>