Hi

I want to retrieve a row of MySQL data using Perl and DBI, so I do it like 
this:

[code]
         my $sqlquery = qq|SELECT * FROM ata_members WHERE id=$id|;
         $sth = $dbh->prepare($sqlquery);
         $sth->execute or die("Can't execute SQL query. [$DBI::err] 
$DBI::errstr");
         $ref = $sth->fetchrow_hashref();
         $sth->finish;
[/code]

But what I want is to populate a %hash with all name/value pairs retruned 
from this query. I tried:

[code]
         my %hash = %$ref;
[/code]

But that doesn't work. Anyone else got any ideas? Maybe there's a better 
way to retrieve the information from MySQL?

--
Wiliam Stephens <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to