$itemID = 575;
mysql_connect(localhost, "otf_books", "l1brarY0f10f");
@mysql_select_db("outpost10f") or die("Unable to select database");
$result = mysql_query("
SELECT
item.title,
DATE_FORMAT(item.publicationDate, '%M, %Y') as pub,
item.amazonID,
item.timeline,
item.authorID,
item.genreID,
author.firstName,
author.lastName,
genre.genre,
series.series
FROM
library_item as item,
library_author as author,
library_genre as genre,
library_series as series
WHERE
item.itemID = $itemID AND
item.authorID = author.authorID AND
item.genreID = genre.genreID AND
item.seriesID = series.seriesID
");
$title=mysql_result($result,0,"item.title");
$date=mysql_result($result,0,"pub");
$amazonID=mysql_result($result,0,"item.amazonID");
$timeline=mysql_result($result,0,"item.timeline");
$authorFirstName=mysql_result($result,0,"author.firstName");
$authorLastName=mysql_result($result,0,"author.lastName");
$genre=mysql_result($result,0,"genre.genre");
$series=mysql_result($result,0,"series.series");
$genreID=mysql_result($result,0,"item.genreID");
$reviews = mysql_query("
SELECT
off.handle,
off.rankLevelID,
review.review,
DATE_FORMAT(review.reviewDate, '%M %e, %Y') as reviewDate,
review.rating,
review.reviewerID
FROM
library_review as review,
Officer as off
WHERE
review.itemID = $itemID AND
review.reviewerID = off.officerID
ORDER BY
review.reviewDate ASC
");
$recentReviews = mysql_query("
SELECT
item.title,
item.filename,
genre.folder,
subgenre.folder
FROM
library_review as review,
library_item as item,
library_subgenre as subgenre,
library_genre as genre
WHERE
item.itemID = review.itemID AND
item.genreID = $genreID AND
item.subgenreID = subgenre.subgenreID AND
item.genreID = genre.genreID
ORDER BY
review.reviewDate DESC
LIMIT
4
");
?>