[Templates] MySQL problem continued

[prev] [thread] [next] [Date index for 2005/01/19]

From: Shanta McBain
Subject: [Templates] MySQL problem continued
Date: 19:33 on 19 Jan 2005
Hi I am still working on a problem with TTML and MySQL

my code is such

[%# this gets the items in the item_tb that are containers %]
[% FOREACH container_item = DBI.query("SELECT * 
                                  FROM item_tb 
                                  WHERE is_container = '1'
                                  ORDER BY  item_name
                                  ")%]    
                                
                                  <tr>
   <td class="NavTableCellStyle">
   [% container_item.item_name%]
     </td>
     <td></td>   
     <td class="NavTableCellStyle">
  
 [% container_item.location%]
     </td>
      <td class="NavTableCellStyle">
   <a href="/cgi-bin/Inventory/item.cgi?site=[% SiteName %]&amp;location=[% 
container_item.item_code%]&amp;display_add_form=on&amp;[% session_string %]" 
target="_new" name="Add Item">Add</a>
     </td>
 </tr>

[%# This nested Loop gets all the items in item_tb that are located in the 
above selected item. %]

[% FOREACH item = DBI.query("SELECT * 
                                  FROM item_tb 
                                  WHERE location = 
'${container_item.item_code}'
                                  ORDER BY  item_name
                                  ")%]    
                               
                                  <tr>
  <td></td> <td class="NavTableCellStyle">
   [% record_id =item.record_id%] 
   [% item.item_name %]
     </td>
       <td class="NavTableCellStyle">
   <a href="/cgi-bin/Inventory/item.cgi?site=[% SiteName 
%]&amp;display_modification_form=on&amp;record_id=[% record_id %]&amp;[% 
session_string %]" target="_new" name="Modify Item">Modify</a>
     </td>
  </tr>
[% END %]
[% END %]

My problem is there are more items that are defined as containers in the 
table. The Primary loop runs two times and stops.

Anyone got any Ideas????

        -- 
        Thanks
Shanta McBain
Http://computersystemconsulting.ca Web hosting and Application Hosting.

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] MySQL problem continued
Shanta McBain 19:33 on 19 Jan 2005

RE: [Templates] MySQL problem continued
Simon Matthews 10:39 on 20 Jan 2005

Re: [Templates] MySQL problem continued
Shanta McBain 17:26 on 21 Jan 2005

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52