fetchrow_array() will just get you one row of results at a time (as you're
finding). What you want to do is loop through all the lines of results that
you get, along the lines of:
while (my @rows = $sth->fetchrow_array()) { # Gets each row of the
# results one at a time
doSomethingWithTheResults()
}
Cheers
Mark C
> -----Original Message-----
> From: David Draley [mailto:[EMAIL PROTECTED]]
> Sent: 08 August 2001 14:28
> To: [EMAIL PROTECTED]
> Subject: PERL Array to hash table help
>
>
> hello -
>
> I am writing a search script that will retrieve records from
> an MYSQL db. I
> have used an array to store the returned records, but I am
> having problems
> pushing the array into a hash table. So far, my search
> script only returns
> the first record that matches the search criteria.
>
> thanks in advance
>
> -------------------------------------
> my $sth = $dbh->prepare( "SELECT * FROM survey WHERE facil =
> '$species'" );
>
> $sth->execute();
>
> @rows = $sth->fetchrow_array();
>
>
> <html>.....
>
> @rows
> ....</html>
>
> --------------------------------------
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]