Reply to Re: TOP

Your name:

Reply:


Posted by Vince Morgan on 04/27/07 06:36

"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:f75333l2ep35g034mia83q9j5s7it23j07@4ax.com...
> 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");

You have made my day Geoff! That is perfect. The db is foxpro I beleive,
but it could be dbase. No one seems to actualy know.
The data is pulled from the companies stock and accounting db, and they have
no real idea. The db develloper is being hedgey about it too.
Highest regards,
Vince

[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

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