Re: [Templates] multiple fields from SQL query --Update

2012-05-31 Thread Mark Haney
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

Re: [Templates] multiple fields from SQL query --Update

2012-05-31 Thread Mark Haney
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

Re: [Templates] multiple fields from SQL query --Update

2012-05-29 Thread Mark Haney
On 05/24/2012 02:53 PM, Theunis De Klerk wrote: Hi Mark, I am not sure I understand exactly what you are trying to achieve, but I think you are right about putting it into a scalar. As an example, how does this work for you : my @rows_factory; while ( my @factory_data =

[Templates] multiple fields from SQL query

2012-05-24 Thread Mark Haney
I've got a query in my perl code to pull 2 fields from a database (abbreviation, factory_id), one of which is used to populate a dropdown box (abbreviation). However, I will need to pass /both/ fields to the CGI script that I'm calling from the form that has the dropdown box. How do I do

Re: [Templates] multiple fields from SQL query

2012-05-24 Thread Dave Howorth
Mark Haney wrote: I've got a query in my perl code to pull 2 fields from a database (abbreviation, factory_id), one of which is used to populate a dropdown box (abbreviation). However, I will need to pass /both/ fields to the CGI script that I'm calling from the form that has the dropdown

Re: [Templates] multiple fields from SQL query --Update

2012-05-24 Thread Mark Haney
On 05/24/2012 10:52 AM, Mark Haney wrote: I've got a query in my perl code to pull 2 fields from a database (abbreviation, factory_id), one of which is used to populate a dropdown box (abbreviation). However, I will need to pass /both/ fields to the CGI script that I'm calling from the form that

Re: [Templates] multiple fields from SQL query --Update

2012-05-24 Thread Theunis De Klerk
On 5/24/2012 8:14 PM, Mark Haney wrote: On 05/24/2012 10:52 AM, Mark Haney wrote: my $row_factory; my @rows_factory; while ($row_factory = $sth-fetchrow_array) { push @rows_factory, $row_factory; # This moves each row into the array @rows } $sth-finish(); I've had a couple of good

Re: [Templates] multiple fields from SQL query --Update

2012-05-24 Thread Todd Freeman
You are correct... try fetchrow_arrayref and you should get what you are expecting On 05/24/2012 02:14 PM, Mark Haney wrote: On 05/24/2012 10:52 AM, Mark Haney wrote: I've got a query in my perl code to pull 2 fields from a database (abbreviation, factory_id), one of which is used to