Oh great DBI users.
I am foreseeing a problem (though I am not there yet).
(background)
I am porting a dbase (Foxpro for DOS) application to MySQL.
I have managed to get enough of it running with test some data and
forms. I am starting to feel reasonably comfortable with the idea. But
here late on a Sunday night I am having visions of data evilness.
(meat of the problem)
I have browse forms that seem to work fine using the "SELECT bla,bla
FROM DATA" logic when there is no filter criteria and displaying them
with fecthall_arrayref().
Like..
my $dbh = DBI->connect( "dbi:mysql:$dh:$server",,);
my $sth = $dbh->prepare( "SELECT FNAME, LNAME, NUMBER FROM
phones ORDER BY FNAME ASC" );
$sth->execute();
my $rows = $sth->fetchall_arrayref();
my $tablerows =
Tr( th( { -bgcolor => "#dddddd", -align=>'left'
},
[ "First", "Last" ]),
th( { -bgcolor => "#dddddd" }, [
"Number"] ));
foreach my $row( @$rows ){
$tablerows .= Tr( td( { -bgcolor => "#dddddd" },
$row ));
}
(As in select all and show all- sounds like the correct default) . This
works great with 100 or so test records I have in the system but I am
flashing forward to the day (in the not so distant future) when there
will 100,000 records in the system.
The way I understand it, it will select all 100,000 and then try and
display them all. Between the server and the browser something is bound
to break or get stupefying slow. Am I wrong? Most of the time people
are going to have filter criteria in the display - maybe it doesn't
matter. But how do I mimic the "show all" logic but only actually show
the first 200 records (and at the end allow a browse to continue through
the next 200 records?
Is this a stupid question?
Ron "Elvis" Stephan
310-840-4111
[EMAIL PROTECTED]