Reply to Re: LIMIT clause problems

Your name:

Reply:


Posted by Andy Hassall on 08/06/05 13:49

On Sat, 06 Aug 2005 10:42:33 GMT, Mike <user@domain.com> wrote:

> $cur_page = $_GET['next_page'];
> $page_num = $cur_page + 1;
> $record = ($cur_page * $records_per_page) + 5;
> $total_num_page = $last_page_num = ceil($total_recs/
>$records_per_page);
>
> $limit_str = "LIMIT ". $cur_page * $records_per_page . ", $record";

http://dev.mysql.com/doc/mysql/en/select.html
[LIMIT {[offset,] row_count | row_count OFFSET offset}]

It's not LIMIT from_offset, to_offset.
it's LIMIT offset, row_count.

So surely something more like:

$limit_str = "LIMIT ". $cur_page * $records_per_page . ", $records_per_page";

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация