more useful options | |
PerlMonks |
Re^5: Retrieving multiple records from databaseby davido (Cardinal) |
on Oct 17, 2004 at 15:41 UTC ( [id://399925]=note: print w/replies, xml ) | Need Help?? |
You have to build the column into your SQL statement. The first statement here will select all columns.
And this will select just one column:
In the case of the second SQL statement, fetchrow_array() will return an array of one single element. There is a pretty good basic SQL tutorial at http://www.w3schools.com/sql/default.asp. Another alternative is the $slice parameter of the fetchall_arrayref() method. By passing an anonymous arrayref containing the element numbers you're after, you can "slice" the arrayref for each row so that only certain columns are seen. This is documented in DBI. Dave
In Section
Seekers of Perl Wisdom
|
|