You are here: Re: question about processing MySQL query result « PHP Programming Language « IT news, forums, messages
Re: question about processing MySQL query result

Posted by 427SOHC on 06/22/06 08:07

In article <e7dhet$12kc$1@justice.itsc.cuhk.edu.hk>, vito says...
>
>
>"strawberry" <zac.carey@gmail.com> wrote in message
>news:1150957042.637266.181010@m73g2000cwd.googlegroups.com...
>> in the query itself you could add 'order by rand() limit 4'
>
>It works!
>
>Now i'd like to implement a page function to separate 1000 records into 20
>pages. But since the associative array does not use numeric index, i'm
>unable to do so. Is there any good methods?
>
>p.s. for numeric index:
>
>I can generate, e..g.
>
>Page 1 2 3 4 5 6 ...
>
>and then calculate the mathematics and say, display a table by:
>
>record[pageno*20+offset] record[pageno*20+offset+1]
>record[pageno*20+offset+2]
>
>and so on.
>
>

Maybe you can use multidimensional arrays. That way you can start with an
indexed array, that can preserve the sort order from your SQL query. For each
row you can then store the values of the columns as key/value pairs


--
Unlimited Newsgroup Download Day
Newsguy Bandwidth Blowout 6-29-06
More Info - http://www.newsguy.com/nolimits.htm

 

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

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