如何用两个语句创建分页?

时间:2016-04-22 10:28:46

标签: php pagination statements

if(isset($_GET['cat'])){

        $categoryID = $_GET['cat'];

    $sql_getcatStock="SELECT * FROM stock where categoryID='$categoryID'";

         $query_getcatStock=mysqli_query($dbconnect, $sql_getcatStock);

         $count = mysqli_num_rows($query_getcatStock);

         if($count==0){
             echo "<h6>No Shops Found In This Category!</h6>";
         }

       while($rs_getcatStock=mysqli_fetch_array($query_getcatStock)){

           $name = $rs_getcatStock['name'];
           $stockID = $rs_getcatStock['stockID'];


           echo "

           <div class='block-inner'>


           <p><a href = 'details.php?Id=$stockID'>$name</a></p></div>";
       }
   }

我像这样建立链接

<p><a href = 'details.php?Id=$stockID&page=$page'>$name</a></p>

0 个答案:

没有答案