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
[Back to original message]
|