You are here: Re: TOP « PHP Programming Language « IT news, forums, messages
Re: TOP

Posted by Geoff Berrow on 04/27/07 06:25

Message-ID: <46318ed6$0$9772$afc38c87@news.optusnet.com.au> from Vince
Morgan contained the following:

>It would be preferable to be able to click say [Next 200], and alow viewing
>25 at a time. And that's where my head starts to spin.
>I can't imagine putting 5000 records into the $_SESSION as an array and then
>selecting 200 at a time, it seems like a huge amount of data.

Well no, the answer is to write the query to give you what you want.
You don't say what database you are using but as you mention TOP I guess
you are not using MySQL MySQL has a handy LIMIT feature which makes
pagination easy.

The first set of results is easy, top 200. the next set is the top 200
where the result is not in the first top 200, something like

$query = odbc_exec($odbc,"SELECT TOP 10 * FROM table where id not in
(SELECT TOP $offset id FROM table ORDER BY date_entered DESC) ORDER BY
date_entered DESC");
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

Navigation:

[Reply to this 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

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