[Catalyst] Variable in where clause

Danh Nguyen tongnguyen at rogers.com
Wed Sep 14 05:51:21 CEST 2005


Hi,

I wantto put a variable in the WHERE clause in Template. something like this:

[% USE DBI('dbi:SQLite:C:\minimojo.db ') %]
 
 [% SET myid= 2 %]
    
    [% FOREACH user = DBI.query('SELECT * FROM user WHERE id= myid') %]

    <table border="1" width="54%">
      <tr>
        <td width="15%">User ID</td>
        <td width="85%">[% user.id %]<td>
      </tr>
      <    </table>
    [% END %]

I have tried all possible syntax, but cannot get it. Anyone could help me out?

Thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050913/54ae30f3/attachment.htm


More information about the Catalyst mailing list