Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: DBI Row Limitingby zdog (Priest) |
on Sep 14, 2004 at 16:59 UTC ( [id://390910]=note: print w/replies, xml ) | Need Help?? |
There in fact are method(s) that limit the number of results you get. They're called fetchrow_*(). They limit the number of results to one row so you can control however many you actually obtain. Straight out of the DBI documentation:
Now you can transform this a little to suit your needs like merlyn was talking about:
This code is untested but you get the general idea. There are other types of fetchrow_*() methods that you can take a look at. Read the DBI documentation. Update: You can also take a look at the fetchall_arrayref() method which appears to take a $max_rows parameter. Zenon Zabinski | zdog | zdog@perlmonk.org
In Section
Seekers of Perl Wisdom
|
|