Reply to Re: Paginate from group by

Your name:

Reply:


Posted by joanna on 10/28/07 12:54

On Oct 28, 7:53 am, bmic...@gmail.com wrote:
> If I understand your problem correctly; you're having problem
> distributing the SQL query on several pages.
>
> By using ORDER BY, you can keep track of what was displayed already.
>
> SELECT ID,Title
> FROM table
> WHERE Title LIKE '" . $_GET['title'] . "%'
> ORDER BY title
> LIMIT 0, 100
>
> Depending on how many results you want to display per page (let's say
> 100). You can modify the LIMIT. That is for page 1 'LIMIT 0, 100', for
> page 2 'LIMIT 100, 200' and so on
>
> >> echo "<td><a href=\"page2.php?title=" .$title. "\"> $title</a></td>
>
> This here looks like a bad design idea. You should instead have a
> variable (which you can pass through $_GET), which tells you which
> page you're on.
>
> $params = "?title=" . $title . "&page=" . $page;
>
> Hope this helps

It kind of helps, the order by is something that was needed. However,
maybe I wasn't clear, but I'm having a tough time trying to paginate
the rest of the results as in a "next" and "previous" link at the
bottom. The results are in the thousands and doing a manual page for
each 100 results would be too much.

[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

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