If I don't use dollar, that is to say

   [% USE DBI('dbi:mysql:netstore','root','Saverio1978') %]
   [% query = "SELECT * FROM projects WHERE NameProject = $project" %]
   [% query %]
   [% pdata = DBI.prepare(query) %]
   [% column = pdata.execute %]
    <tr><td>Project type: [% column.Type %]</td></tr>
   <tr><td>Project language: [% column.Language %]</td></tr>
   <tr><td>Project description: [% column.Description %]</td></tr>


then I have the following message:

Software error:

DBI error - execute failed: Unknown column 'Prova' in 'where clause'

Where is the problem?


--- Lun 22/3/10, C. Chad Wallace <[email protected]> ha scritto:

> Da: C. Chad Wallace <[email protected]>
> Oggetto: Re: [Templates] problem with USE DBI
> A: [email protected]
> Data: Lunedì 22 marzo 2010, 19:33
> 
> At 4:18 PM on 22 Mar 2010, dark0s wrote:
> 
> > I have the following tt2/html code:
> > 
> >    [% USE
> DBI('dbi:mysql:netstore','root','Saverio') %]
> >    [% query = "SELECT * FROM projects WHERE
> NameProject = $project" %]
> >    [% query %]
> >    [% pdata = DBI.prepare($query) %]
>                
>             ^
> Don't use the dollar sign here.
> 
> In TT, dollar signs are used for dereferencing.  query
> is not a
> reference, so you don't get anything.
> 
> 
> -- 
> 
> C. Chad Wallace, B.Sc.
> The Lodging Company
> http://www.lodgingcompany.com/
> OpenPGP Public Key ID: 0x262208A0
> 
> 
> -----Segue allegato-----
> 
> _______________________________________________
> 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