Re: Pagination

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



watch out for SQL injection attacks on that one though:

what if the 'user' went to "page.php?start=1;SELECT * from `mysql`;


On Thu, 24 Mar 2005 22:55:01 +0100, pavel <pavel@xxxxxx> wrote:
> > I am wanting to paginate records from a MySQL Database.
> > I want there to be 5 records on a page, on multiple pages.
> 
> example for selecting page of records from mysql table:
> $sql=sprintf("
>         SELECT SQL_CALC_FOUND_ROWS * FROM table LIMIT %d, %d",
>         $position*$records,
>         $records
> );
> 
> after get count of all records:
> $sql='SELECT FOUND_ROWS()';
> 
> > (I would like there to be a "next" and "previous.")
> 
> you can use http://pear.php.net/package/Pager
> 
> --
> Pavel Vrany
> http://ogi.cz/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux