Professional Web Applications Themes

Create hash from MySQL field headers - PERL Beginners

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...

  1. #1

    Default Create hash from MySQL field headers

    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

    Steve Guest

  2. #2

    Default Re: Create hash from MySQL field headers

    Steve Bertrand wrote:
     

    Hello,
     

    perldoc DBI
    look for selectrow_hashref

    HTH :)

    Lee.M - JupiterHost.Net
    JupiterHost.Net Guest

  3. #3

    Default Re: Create hash from MySQL field headers

    > Steve Bertrand wrote: 
    >
    > Hello,

    >
    > perldoc DBI
    > look for selectrow_hashref[/ref]

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

    I'm certain it will.

    Thanks again!

    Steve
     


    Steve Guest

  4. #4

    Default Re: Create hash from MySQL field headers

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

    Glad I could help :)
     
    >
    > I'm certain it will.
    >
    > Thanks again!
    >
    > Steve
    > [/ref]

    JupiterHost.Net Guest

Similar Threads

  1. #40324 [NEW]: Create a way to capture/unset headers sent by ob_gzhandler ?
    By nicolas dot grekas+php at gmail dot com in forum PHP Bugs
    Replies: 0
    Last Post: February 2nd, 12:43 PM
  2. How to Create a hash using SQL 2000
    By Neill Taylor in forum PERL Beginners
    Replies: 3
    Last Post: December 16th, 04:34 PM
  3. List Hash 'Field' Names
    By Paanwa in forum PERL Miscellaneous
    Replies: 0
    Last Post: September 10th, 09:31 PM
  4. [PHP] Howto list Mysql Table Headers using PHP
    By Ow Mun Heng in forum PHP Development
    Replies: 0
    Last Post: July 21st, 01:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139