RE: [Templates] MySQL Question
[prev]
[thread]
[next]
[Date index for 2004/11/10]
> [% FOREACH logentry =3D DBI.query("SELECT * FROM =
altpower_battery_log_tb
> WHERE (project_code =3D "[%
item_code %]"=20
> )
> ")%] =20
You can't embed TT tags inside each other like that. What you want is to
interpolate a variable into your double-quoted string, like so:
[% FOREACH logentry =3D DBI.query("SELECT * FROM altpower_battery_log_tb
WHERE (project_code =3D
$item_code
)
")%] =20
This can actually be done without putting the field value into a
temporary value, like this:
[% FOREACH logentry =3D DBI.query("SELECT * FROM altpower_battery_log_tb
WHERE (project_code =3D
${item.item_code}
)
")%] =20
Hope that helps!
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
(message missing)
|