fetchrow_array

fetchrow_array returns an array rather than a reference to an array. This is another way it can be used to fetch data from a handle. Each method does basically the same thing, so you can choose the method you prefer.

Example:

while(my($author, $title, $price) = $handle->fetchrow_array){     print "Title: $title, Author: $author, Price: $price\n"; } while(my(@array) = $handle->fetchrow_array){     print "Title: $array[1], Author: $array[0], Price: $array[2]\n"; }

These examples simply loop through the data and print each record until there are no more.



Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net