For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2004 > Create hash from MySQL field headers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Create hash from MySQL field headers
Steve Bertrand

2004-09-30, 2:55 am

Hi all,

I've been developing a module for our accounting system and am trying
to create a hash with the names equal to the fieldnames of the
database table.

It seems as though 'ListFields' is not functioning, and am wondering
if there is another way.

I simply want to SELECT a single line from the table, have it stored
in a hash, with the name as the fieldname and the value as the actual
data.

Any help would be greatly appreciated, and I am not afraid to go
R'ingAFM if someone could supply decent links.

TIA,

Steve

JupiterHost.Net

2004-09-30, 2:55 am

Steve Bertrand wrote:

> Hi all,


Hello,

> I've been developing a module for our accounting system and am trying
> to create a hash with the names equal to the fieldnames of the
> database table.
>
> It seems as though 'ListFields' is not functioning, and am wondering
> if there is another way.
>
> I simply want to SELECT a single line from the table, have it stored
> in a hash, with the name as the fieldname and the value as the actual
> data.
>
> Any help would be greatly appreciated, and I am not afraid to go
> R'ingAFM if someone could supply decent links.


perldoc DBI
look for selectrow_hashref

HTH :)

Lee.M - JupiterHost.Net
Steve Bertrand

2004-09-30, 2:55 am

> Steve Bertrand wrote:
>
>
> Hello,
>
>
> perldoc DBI
> look for selectrow_hashref


Mucho gracias... I'll look it up, but the name certainly implies that
it is what I am after.

> HTH :)


I'm certain it will.

Thanks again!

Steve

>
> Lee.M - JupiterHost.Net
>



JupiterHost.Net

2004-09-30, 2:55 am

>>perldoc DBI
>
>
> Mucho gracias... I'll look it up, but the name certainly implies that
> it is what I am after.


Glad I could help :)
[color=darkred]
>
> I'm certain it will.
>
> Thanks again!
>
> Steve
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com