CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Store data to a perl hash



Feb 15, 2009, 7:06 AM

Post #1 of 2 (411 views)
Store data to a perl hash Can't Post

How can I move all the data from a SQL query to a perl hash?

I know how I can do this to an array but I cannot get it to work using a hash. Here is how I move the results from a query to an array.

 my @doc = (); 
my $sSQL = "SELECT tbl_terms.term FROM tbl_doc, tbl_terms WHERE tbl_doc.docID = tbl_terms.docID AND tbl_doc.docID = 58";
@doc = @{$dbh->selectcol_arrayref($sSQL)};

How can I do this with a hash?

Veteran / Moderator

Feb 15, 2009, 7:20 AM

Post #2 of 2 (410 views)
Re: [Ennio] Store data to a perl hash [In reply to] Can't Post


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives