| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
limiting results
Right I've got a foreach loop displaying some results of some crazy ass db queries. All working fine... Code:
I need to limit the results though so tried this instead Code:
It doesn't work. Anyone know why? That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Mar 2004
Location: Derby, UK
Posts: 24
|
What does $order hold at the beginning of this code? I am guessing from the way you use it in the first example that it is an associative array (not a straight numeric array) in which case you cannot just loop through the items from 0-9 as you are trying to do, since this will not work. You could either use a loop variable in the first example or truncate the $order array to ten items before you start the loop, not sure which will be easier without knowing what your data looks like. HTH, Dai |
|
|
|
#3 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,236
|
OK here's some more example code. Like I say, this works but I need to limit the results. Any help appreciated. Code:
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
![]() |