require "includes/session.php"; if($_GET['limit']){ $itemsPerPage=$_GET['limit']; $_SESSION['itemsPerPage']=$itemsPerPage; }elseif(isset($_SESSION['itemsPerPage'])){ $itemsPerPage=$_SESSION['itemsPerPage']; }else{ $itemsPerPage=50; } ?>
$pageTitle="Book List";?> require "includes/head.php";?> if($_GET['bk_top']){ $bk_top = $_GET['bk_top']; $bk_top = strtoupper($bk_top); $book_link = 'http://www.mjdtools.com/books/'; }else{ $bk_top=''; } if($_GET['page']){ $start=($_GET['page'] - 1) * $itemsPerPage; }else{ $start=0; } //Used for pagination finds total number of records (must have same WHERE as next SQL SetToolsDB(); $SQL = "SELECT COUNT(*) as num FROM htm_book WHERE NUM_BOOKS>0 AND $bk_top=1 AND BK_PRICE<>'0.00' AND IS_CLONE=0 "; //$total_records = mysql_fetch_array(mysql_db_query($dbname,$SQL)); //$total_records = $total_records[num]; $total_records = mysql_db_query($dbname,$SQL); $total_records=mysql_result($total_records,0,"num"); $SQL = "SELECT HTM_TITLE,SUB_HEAD FROM bk_topic WHERE LIST_NAME='".$_GET['bk_top']."'"; //select the home section $title = mysql_db_query($dbname, $SQL) or die("Failed Query of " . $SQL); //do the query $titleCount = mysql_numrows($title); ?> require "includes/bodyPage.php";?> echo $curPath;?>echo mysql_result($title,0,"SUB_HEAD");?>
//SQL pull only records between start and items per page $SQL = "SELECT * FROM htm_book WHERE NUM_BOOKS>0 AND $bk_top=1 AND BK_PRICE<>'0.00' AND IS_CLONE=0 ORDER BY TITLE"; //select the home section if($itemsPerPage!="NA"){ $SQL=$SQL." LIMIT $start, $itemsPerPage;"; //select the home section } $results = mysql_db_query($dbname, $SQL) or die("Failed Query of " . $SQL); //do the query $RecCount = mysql_numrows($results); ?>|
"> "> Shorten(mysql_result($results,$i,"TITLE"),40);?> " style="font-size:.9em;"> Shorten(mysql_result($results,$i,"BY_lINE"),20);?> echo mysql_result($results,$i,"HOW_BOUND");?> $ echo mysql_result($results,$i,"BK_PRICE")?> |
if ($j==5){ $j=1;?>