예제 #1
0
 if (isset($_GET["page"])) {
     $page = abs($_GET["page"]);
 } else {
     $page = 1;
 }
 $start_from = ($page - 1) * $max_results;
 $Total_Animals = "SELECT Animals_ID FROM animal WHERE Verified='No' AND Added_By={$_SESSION['Member_ID']}";
 $totalresults = mysql_query($Total_Animals);
 $total = mysql_num_rows($totalresults);
 $total_pgs = ceil($total / $max_results);
 $This_Page_SQL = "SELECT Animals_ID, Animal, Breed, Price, Image_1 FROM animal WHERE Verified='No' AND Added_By={$_SESSION['Member_ID']} ORDER BY Views ASC LIMIT {$start_from}, {$max_results}";
 $result = mysql_query($This_Page_SQL, $conn) or die(mysql_error());
 $this_page_total = mysql_num_rows($result);
 $this_page_total_2 = mysql_num_rows($result);
 $this_page_total = ($page - 1) * $max_results + $this_page_total;
 $posision = getStartPossion($page, $max_results);
 $itemstart = $start_from + 1;
 if ($total != 0) {
     if ($max_results > $total) {
         echo "Showing {$itemstart} - {$total} of {$total} Animals<br><br>";
     } else {
         echo "Showing {$itemstart} - {$this_page_total} of {$total} Animals<br><br>";
     }
 } else {
     echo "Showing 0 - 0 of 0 Businesses<br><br>";
 }
 //
 while ($newArray = mysql_fetch_array($result)) {
     //$id = $newArray['ID'];
     $Animals_ID = $newArray['Animals_ID'];
     $Animal = $newArray['Animal'];
예제 #2
0
$max_results = 10;
if (isset($_GET["page"])) {
    $page = $_GET["page"];
} else {
    $page = 1;
}
$start_from = ($page - 1) * 10;
$totalcars = "SELECT Product_ID FROM product WHERE Verified='No'";
$totalresults = mysql_query($totalcars);
$total = mysql_num_rows($totalresults);
$total_pgs = ceil($total / $max_results);
$sql = "SELECT Product_ID, Animal, Product, Price, Image, Added_By FROM product WHERE Verified='No' LIMIT {$start_from}, {$max_results}";
$result = mysql_query($sql, $conn) or die(mysql_error());
$this_page_total = mysql_num_rows($result);
$this_page_total = ($page - 1) * $max_results + $this_page_total;
$posision = getStartPossion($page);
$itemstart = $start_from + 1;
if ($total != 0) {
    if ($max_results > $total) {
        echo "<br>Showing {$itemstart} - {$total} of {$total} Products<br><br>";
    } else {
        echo "<br>Showing {$itemstart} - {$this_page_total} of {$total} Products<br><br>";
    }
} else {
    echo "<br>Showing 0 - 0 of 0 Products<br><br>";
}
//	, , , Price, , Added_By
while ($newArray = mysql_fetch_array($result)) {
    $Product_ID = $newArray['Product_ID'];
    $Animal = $newArray['Animal'];
    $Product = $newArray['Product'];