[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 xkorakidis
. Unnawut Leepaisalsuwanna wrote: $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

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? Thanks Everybody!

2005-11-23 Thread xkorakidis
in case someone tries to put in decimals and ruin the query the $perpage is the number of rows you want to display xkorakidis wrote: 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

[PHP-DB] timestamp value management

2006-01-29 Thread xkorakidis
hi guys! I'm trying to manage a table containing a timestamp colum - when I insert a record, I don't fill a value in timestamp column, so current timestamp is inserted. The inserted value is smth like 20060129213253 - when I try to show this value in a php page, I use date($varOfTimestampColumn)