Re: multiple fields from SQL query --Update

Mark Haney <markh-rOuQeLG7NUhWk0Htik3J/[email protected]> Thu, 31 May 2012 10:30:14 -0400
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
On 05/24/2012 02:53 PM, Theunis De Klerk wrote:

>
> As an example, how does this work for you :
>
> my @rows_factory;
> while ( my @factory_data = $sth->fetchrow_array() )
> {
> push @rows_factory, {'id' => $factory_data[0], 'abbr' => $factory_data[1]};
> }
>
> I normally do that when I want to do this in the template :
>
> <select name="factory">
> [% FOREACH factory IN factories %]
> <option value="[% factory.id %]" size="20">[% factory.abbr %]</option>
> [% END %]
> </select>
>

Well, after putting out a few fires here, I had a chance to try this and 
unfortunately got nothing.  And I'm not at all sure why.  With my 
original code I got the Factory abbreviation to show up in the drop down 
just fine.  Granted it didn't include the id, but at least I had that 
part working.

I'm at a loss now.


-- 

Mark Haney
Software Developer/Consultant
AB Emblem
markh-rOuQeLG7NUhWk0Htik3J/[email protected]
Linux marius.homelinux 3.3.7-1.fc16.x86_64 GNU/Linux