Professional Web Applications Themes

DBI::mysql column names as hash keys? - PERL Modules

Removed by Administrator...

  1. Moderated Post

    Default DBI::mysql column names as hash keys?

    Removed by Administrator
    Tony Guest
    Moderated Post

  2. #2

    Default Re: DBI::mysql column names as hash keys?

    On Fri, 6 Feb 2004 08:18:52 +1100, [email]hawkmoon1972hotmail.com[/email] wrote:

    Hello Hawk

    Perhaps with DBIx::Admin::TableInfo. CPAN is your friend.

    --
    Cheers
    Ron Savage, [email]ronsavage.net.au[/email] on 6/02/2004
    [url]http://savage.net.au/index.html[/url]

    Ron Savage Guest

  3. Moderated Post

    Default Re: DBI::mysql column names as hash keys?

    Removed by Administrator
    cp Guest
    Moderated Post

  4. Moderated Post

    Default Re: DBI::mysql column names as hash keys?

    Removed by Administrator
    Tony Guest
    Moderated Post

  5. Moderated Post

    Default Re: DBI::mysql column names as hash keys?

    Removed by Administrator
    Dan Bolser Guest
    Moderated Post

  6. #6

    Default Re: DBI::mysql column names as hash keys?

    In article <c90e5468.0402080623.11e825d7posting.google.com >, Tony
    <hawkmoon1972hotmail.com> wrote:
    > Thanks cp, but the question is...
    Actually, the question seems to be "How can I cross-post instead of
    multi-posting?"

    You same querstion was asked and answered in another news group, It is
    rude to post the same question twice to different news groups (
    multi-posting). Instead, you should ask the question once, giving
    multiple news groups as the target (cross-posting).

    --
    cp
    cp Guest

  7. #7

    Default Re: DBI::mysql column names as hash keys?

    Thanks for pointing me in the right direction guys.

    For the record, this is what I ended up with:


    $sth1 = $dbh->prepare("SELECT * FROM human where name = ?");
    my $rv = $sth1->execute("Bob");

    if ($rv > 0) {
    while ($hash_ref = $sth1->fetchrow_hashref) {

    $vars{"human"} = {%$hash_ref}; # THIS WAS THE ELUSIVE PART!!!

    my $tt = Template->new;
    $tt->process('test.txt', \%vars, 'test.txt.out');

    }
    } else {
    printf "no results\n";
    };
    Tony Guest

Similar Threads

  1. counting column and getting column names
    By dduck1934 in forum Coldfusion Database Access
    Replies: 0
    Last Post: May 24th, 02:05 PM
  2. multidimentional hash that has both two and three keys
    By Trina Espinoza in forum PERL Beginners
    Replies: 1
    Last Post: January 30th, 12:06 PM
  3. List Hash 'Field' Names
    By Paanwa in forum PERL Miscellaneous
    Replies: 0
    Last Post: September 10th, 09:31 PM
  4. Using slices with 'my' to initialize hash keys and values.
    By David Oswald in forum PERL Miscellaneous
    Replies: 2
    Last Post: August 7th, 02:55 PM
  5. Names of keys, xev vs xmakemap
    By anonylion in forum Sun Solaris
    Replies: 0
    Last Post: June 27th, 08:56 PM

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