Jam - I am creating a read along guide to a series of books. The characters in the books are loaded into a database along with the book number and chapter number they appear in.
This way when a reader visits the page they input which book they're on and which chapter they've read up to. The webpage is supposed to pull only the characters that are less than or equal to the book number they are on and the chapters from the previous books and up to the chapter they are on.
I have it looped so that details are displayed based on the characters that are loaded and the books that they appear in. for example
Suzie appears in book 2 chapter 4
detail 1 of suzie happens in book 2 chapter 4
detail 2 of suzie happens in book 3 chapter 2
So when someone puts in they've read up to book 3 chapter 1 it shows suzie and only detail 1. when they read another chapter it will then show detail 2.
I was having the same troubles with filtering the details as with filtering the characters as I listed above. I tried to fix that problem and now the page is behaving oddly. heres the script for the details after I applied the above fix.
Code: Select all
mysql_select_db($database_lexicon, $lexicon);
$query_Descriptions = "SELECT * FROM description WHERE (CharID = '$GCharID') AND (BookID < '$GBookID') or (BookID = '$GBookID' AND ChapterID <= '$GChapterID')";
$Descriptions = mysql_query($query_Descriptions, $lexicon) or die(mysql_error());
$row_Descriptions = mysql_fetch_assoc($Descriptions);
$totalRows_Descriptions = mysql_num_rows($Descriptions);