in reply to How to use template toolkit variable in a template toolkit mysql query
Does this work for you?
[% FOREACH adds IN DBI.prepare( "SELECT * FROM contacts WHERE account_code = ${row.account_code} A +ND pref_cont != 0" ) %] <option value='[% adds.contact_id %]'>[% adds.contact_address1 %]</opt +ion> [% END %]
With that said, you're probably better off in general extracting this model behavior into a model class of some kind and leaving the view as purely formatting code. That separation of concerns tends to produce programs which are easier to develop and to maintain.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use template toolkit variable in a template toolkit mysql query
by hamidafshar (Novice) on May 04, 2011 at 22:51 UTC | |
by Your Mother (Archbishop) on May 04, 2011 at 23:06 UTC | |
by hamidafshar (Novice) on May 05, 2011 at 06:51 UTC | |
by hamidafshar (Novice) on May 05, 2011 at 06:54 UTC |