The point is that their is no need to build the list of hashes! You can get it straight from the database. By changing:
to:# This method returns a reference to an array of array-refs my $site = $sth->fetchall_arrayref;
Produces a structure which can be directly passed to the TMPL_LOOP, like this:# This method returns a reference to an array of hash-refs my $site = $sth->fetchall_arrayref( {} );
assuming of course that the one field returned, using your example code, was name.$template->param( view => $site );
My reference to dkubb was not to in any way impune what he did, but merely to try and cite the appropriate references as I knew them. The method he used originally was removed and this one obviously added in its place!
In reply to Re: Re: HTML::Template, DBI and <TMPL_LOOP>'s
by jdtoronto
in thread HTML::Template, DBI and <TMPL_LOOP>'s
by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |