View Single Post
Old 30-06-2004, 12:43   #1 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,235
limiting results

Right I've got a foreach loop displaying some results of some crazy ass db queries. All working fine...
Code:
asort($order) foreach ($order as $id => $created) { printf('<a href="%s/%2$s.html">%s</a>', $names[$id]['table'], $names[$id]['name']); }

I need to limit the results though so tried this instead
Code:
asort($order) for ($i = 0; $i < 10; ++$i) { $id = $order[$i]; printf('<a href="%s/%2$s.html">%s</a>', $names[$id]['table'], $names[$id]['name']); }

It doesn't work. Anyone know why?
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote