php pagination from mysql -


i have code:

$total = 12; $limitperpage = 6; $totalpages = ceil($total / $limitperpage); $p = $_get['p']; echo $p;  echo 'total pages: ' . $totalpages . '<br /><br />';  $limitrow = 3; $totalrow = ceil($total / $limitrow);  for($i = 1; $i <= $totalrow; $i++){     $row = ($i * $limitrow) - $limitrow;     echo "from " . $row . ": ";     for($j = 1; $j <= $limitrow; $j++){          echo $row + $j  . " ";     }     echo '<br />'; 

what want pagination that: first page have:

from 0: 1 2 3  3: 4 5 6  

second page:

from 6: 7 8 9  9: 10 11 12  

etc... have set per page 6, maybe later change 9 or 12... code geting sql , needs in way loops throught each , limiting each row. ideas how reach that? know can make $limit 6 , 6 per page, main important thing limit each row.

update: works in way:

<div id="ref1"></div> <div id="ref2"></div> <div id="ref3"></div>  <div id="completeref"> <div id="ref1"></div> <div id="ref2"></div> <div id="ref3"></div> </div> 

that way each row after 3 divs create new div 3 divs in it.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -