[PHP-DB] pagination example?

2005-11-23 Thread xkorakidis
Hi, I'm trying to find a simple example for pagination in php-mysql. I found smth in php classes but it seems too complex (3-4 files and things not so simple). Is there any simple way to do that? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP-DB] pagination example?

2005-11-23 Thread Unnawut Leepaisalsuwanna
$perpage = 10; $page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']); $page = ($page-1) * $perpage; $sql = 'SELECT * FROM `table` WHERE 1 LIMIT '. $page .', '. $perpage; something like this? xkorakidis wrote: Hi, I'm trying to find a simple example for pagination in php-mysql. I

Re: [PHP-DB] pagination example?

2005-11-23 Thread Raz
Try PEAR's Pager package - fairly straightforward to use: http://pear.php.net/package/Pager -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] pagination example?

2005-11-23 Thread xkorakidis
hmmm, it seems simple, althought I didn't yet understand what exactly takes part in $page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']); it seems like a c expression : if page is not numeric page=1 else round page? How does the $perpage increase? couldn't we use smth $page++ ?

Re: [PHP-DB] pagination example?

2005-11-23 Thread xkorakidis
Thanks Raz, it looks proffesional, I'll try to take the advantage of it! Thanks a lot! Christos Korakidis Raz wrote: Try PEAR's Pager package - fairly straightforward to use: http://pear.php.net/package/Pager -- PHP Database Mailing List (http://www.php.net/) To

RE: [PHP-DB] pagination example?

2005-11-23 Thread Bastien Koert
I posted a couple of simple function in the examples section on www.weberdev.com http://www.weberdev.com/get_example-4092.html http://www.weberdev.com/get_example-4093.html bastien From: xkorakidis [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] pagination example? Date: Wed,

Re: [PHP-DB] pagination example? Thanks Everybody!

2005-11-23 Thread xkorakidis
Thanks guys, I'll try all the documentation I and samples collected. Thanks! Unnawut Leepaisalsuwanna wrote: the part $page = (!is_numeric($_GET['page'])) ? '1' : round($_GET['page']); i believe can help prevent sql injection... i rounded the $_GET['page'] as well in