Important Text and Lines From The Importance of Being Ernest , by Oscar Wilde



$lastPage) { // if it is greater than $lastpage $pn = $lastPage; // force it to be $lastpage's value } $centerPages = ""; $sub1 = $pn - 1; $sub2 = $pn - 2; $add1 = $pn + 1; $add2 = $pn + 2; if ($pn == 1) { $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; } else if ($pn == $lastPage) { $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; } else if ($pn > 2 && $pn < ($lastPage - 1)) { $centerPages .= ' ' . $sub2 . ' '; $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; $centerPages .= ' ' . $add2 . ' '; } else if ($pn > 1 && $pn < $lastPage) { $centerPages .= ' ' . $sub1 . ' '; $centerPages .= ' ' . $pn . ' '; $centerPages .= ' ' . $add1 . ' '; } // This line sets the "LIMIT" range... the 2 values we place to choose a range of rows from database in our query $limit = 'LIMIT ' .($pn - 1) * $itemsPerPage .',' .$itemsPerPage; // Now we are going to run the same query as above but this time add $limit onto the end of the SQL syntax // $sql2 is what we will use to fuel our while loop statement below $sql2 = mysql_query("SELECT id, author, book, quote, book_url, author_url, reference FROM quotes where reference ='The Importance of Being Ernest' ORDER BY id ASC $limit"); //////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////// Adam's Pagination Display Setup ///////////////////////////////////////////////////////////////////// $paginationDisplay = ""; // Initialize the pagination output variable // This code runs only if the last page variable is ot equal to 1, if it is only 1 page we require no paginated links to display if ($lastPage != "1"){ // This shows the user what page they are on, and the total number of pages $paginationDisplay .= ' Page ' . $pn . ' of ' . $lastPage. '     '; // If we are not on page 1 we can place the Back button if ($pn != 1) { $previous = $pn - 1; $paginationDisplay .= ' Back '; } // Lay in the clickable numbers display here between the Back and Next links $paginationDisplay .= '' . $centerPages . ''; // If we are not on the very last page we can place the Next button if ($pn != $lastPage) { $nextPage = $pn + 1; $paginationDisplay .= ' Next '; } } ///////////////////////////////////// END Adam's Pagination Display Setup /////////////////////////////////////////////////////////////////////////// // Build the Output Section Here $displaydata = ''; while($row = mysql_fetch_array($sql2)){ $id = $row["id"]; $quote = $row["quote"]; $author= $row["author"]; $book= $row["book"]; $author_url= $row["author_url"]; $book_url= $row["book_url"]; //$displaydata .= echo "
". "Quote : {$row['quote']}
". "
". "". "
". "
"."
"; } // close while loop ?>
      Total Items: