I typed 

   [% query = DBI.prepare('SELECT * FROM projects WHERE NameProject = ?') %]
   [% FOREACH row = query.execute(project); %]
    <tr><td>Project type: [% column.Type %]</td></tr>
   <tr><td>Project language: [% column.Language %]</td></tr>
   <tr><td>Project description: [% column.Description %]</td></tr>
   [% END %]

but it return only three empty values.

Where is a problem?

--- Lun 22/3/10, Chris Travers <[email protected]> ha scritto:

> Da: Chris Travers <[email protected]>
> Oggetto: Re: [Templates] problem with USE DBI
> A: "Randal L. Schwartz" <[email protected]>
> Cc: [email protected]
> Data: Lunedì 22 marzo 2010, 20:13
> On Mon, Mar 22, 2010 at 12:07 PM,
> Randal L. Schwartz
> <[email protected]>
> wrote:
> 
> > Yes, it *does* support parameter binding, which
> should
> > always be preferred to interpolation.
> >
> > [%
> >  query = DBI.prepare('SELECT * FROM projects WHERE
> NameProject = ?';
> >  FOREACH row = query.execute(project);
> >  ...;
> >  END;
> > %]
> 
> That's great.
> >
> > (If only we could make interpolation illegal... :)
> 
> There are a few corner cases where interpolation is
> required.  It
> would be nice to see a nice, standardized way of avoiding
> interpolation with identifiers, for example.....
> 
> Best Wishes,
> Chris Travers
> 
> _______________________________________________
> templates mailing list
> [email protected]
> http://mail.template-toolkit.org/mailman/listinfo/templates
> 


      

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to