Possible Duplicate:
PHP & MySQL Pagination Update Help
So, in my site, there are 10 pages. In each page I want to show different rows from my table. (I am using MySQL for database and I got table called “A”.)
My rows from table in first page:
$result = mysql_query("SELECT * FROM A ORDER BY date DESC LIMIT 20");
My pages:
<div class="pagenavi" >
<span class="pages"><span><a href="index.php"><</a></span>
<span class="currentpage">1</span> -
<a href="/pages/page2.php">2</a> -
<a href="/pages/page3.php">3</a> -
<a href="/pages/page4.php">4</a> -
<a href="/pages/page5.php">5</a> -
<a href="/pages/page6.php">6</a> -
<a href="/pages/page7.php">7</a> -
<a href="/pages/page8.php">8</a> -
<a href="/pages/page9.php">9</a> -
<a href="/pages/page10.php">10</a>
<span id="nextpage"><a href="/pages/page2.php" class="arrow">></a></span>
</span>
</div>
So, in different pages, I can show different rows by changing the limit value, but every time, it goes to another page, not efficient. What I want is that, to show different rows in same page without going another page(for example index.php). If those links were buttons, there would be no problem, but they are not. What can I do?
this can be implemented in a better way. You do not not need to make 10 different PHP scripts but you can do this dynamically using GET variables. Here is a code snippet that explains more:
Hope this helps!
And yes, all the page links now point to index.php.
There is one thing though that I would like to ask. Why do you say there will be no problem if the links were buttons?