Jason,

Hope this will help you get what you want. Of course you need at least one
more loop (calculating the number of 'display' actions from
"sth->numrows()") to repeat the display process for rows 5-10, 11-15, etc.

--------------------


#!/usr/bin/perl

use DBD::mysql;

#connect to database
$dbh = DBI->connect("DBI:mysql:lablog:$dbhost",$dbuser,$dbpass) || die "No
database connection";

#do your query
$sth=$dbh->prepare("SELECT * FROM table WHERE something='wanted'");
$sth->execute();

#display 5 rows containing 3 columns,
for (i=0; i<=4; i++) {
  ($column1, $col2, $col3)=($sth->fetchrow());
  print "Result: $column1, $col2, $col3\n";
}



Regards,

Sebastiaan J.A. Kamp


-----Original Message-----
From: Jason Whitlow [mailto:[EMAIL PROTECTED]]
Sent: maandag 9 juli 2001 0:21
To: '[EMAIL PROTECTED]'
Subject: Question,


I am trying to get on of my apps to display only 5 records at a time. With
Perl attaching to a mysql database. Does anyone have any good Ideas of how
to do this.

Is there a way of doing a select and out of the results saying only give me
5-10 or 10-15?????????????????????????????

Any help would be greatly appreciated

Thank you
Jason

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to