[Templates] MySQL problem continued
[prev]
[thread]
[next]
[Date index for 2005/01/19]
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 %]&location=[%
container_item.item_code%]&display_add_form=on&[% 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
%]&display_modification_form=on&record_id=[% record_id %]&[%
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
|