BR
asked on
Paging Using PHP
Dear experts, I use below code to print out every row in table.
But there are many rows that can not fit in a page.
what I want to do is to list every 100 row in the first page and give "next 100" link for the other 100 so on...
I see it on blog pages.
I want to show query result in multiple pages instead of just put them all in one long page.
How can I do this with php?
My code is:
But there are many rows that can not fit in a page.
what I want to do is to list every 100 row in the first page and give "next 100" link for the other 100 so on...
I see it on blog pages.
I want to show query result in multiple pages instead of just put them all in one long page.
How can I do this with php?
My code is:
$sql9 = "SELECT * FROM xxxxxxx";
$result9 = $conn->query($sql9);
while($row9 = $result9->fetch_assoc()) {
$id= $row9["id"];
$kategori= $row9["kategori"];
$sehir= $row9["sehir"];
echo "<table class=ab width=990px; style=max-width=990px;>
<tr>
<td><span class=yazibaslik>İlan Başığı: $id </span></td>
</tr>
<tr>
<td><span class=yazibaslik>Şehir: $sehir</span></td>
</tr>
<tr>
<td><span class=yazibaslik>Kategori: $kategori </span></td>
</tr>
</table>";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
We also have an article here at EE that covers this topic
https://www.experts-exchange.com/articles/12238/Pagination-with-PHP-and-Mysql.html
https://www.experts-exchange.com/articles/12238/Pagination-with-PHP-and-Mysql.html
ASKER
Thank you Julian. I saw it yesterday after the question. It's perfect. Thank you
Paging means showing your query result in multiple pages instead of just put them all in one long page.Check this helpful link i hope it will help you.
https://www.mindstick.com/ blog/265/p agination- in-php
http://www.freezecoders.co m/2014/01/ simple-pag ination-us ing-php-my sql.html
Thanks
https://www.mindstick.com/
http://www.freezecoders.co
Thanks
Please note the links posted above both refer to samples that make use of the deprecated MySQL library. You should not consider using any code that is still dependent on this library. If you do decide to use the code you should convert it to use MySQLi.
ASKER
thank you Sachin Singh and Julian Hansen,
I will use MySqli, thank you for reminding me this.
I will use MySqli, thank you for reminding me this.
ASKER