Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetching data from database

Status
Not open for further replies.

mooniron

Programmer
Dec 15, 2002
26
TR
Hi all.
I have problem with fetching from database using fetchrow_hashref function.
In fact I can fetch data but if my query returns null from db fetchrow_hashref function returns a null hash reference. So I am unable to use the field names of query which would be returned.
Is there any way to view colomn names without data? Thanks.
 
You could try the table_info method but I have never used it.



table_info NEW
Warning: This method is experimental and may change.

$sth = $dbh->table_info( $catalog, $schema, $table, $type );
$sth = $dbh->table_info( $catalog, $schema, $table, $type, \%attr );
$sth = $dbh->table_info( \%attr ); # old style

Returns an active statement handle that can be used to
fetch information about tables and views that exist in
the database.

The old style interface passes all the parameters as a
reference to an attribute hash with some or all of the
following attributes:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top