printing 2 values per (table) row from db
| From: | jkpsj | Date: | Sun, 19 May 2002 10:23:59 +0000 |
| Subject: | printing 2 values per (table) row from db | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4306@lists.php.net to get a copy of this message | ||
smarty 2.1.1
------------
dear all
i have a caetgory table with 5 category names: Accommodation, Business, Computers, Careers and
Education.
my php script reads in this table and i want to print them like:
Accommodation Business
Computers Careers
Education
my template file:
<table>
{section name=content loop=$category}
{assign var="catname" value=$category[content].cname}
{cycle id=0 values="$catname" print=false}
{cycle id=1 values="$catname" print=false}
{if $tpl.section.content.index is even}
{assign var="cycle_id" value=0}
{else}
{assign var="cycle_id" value=1}
{/if}
<tr>
<td>{cycle id=$cycle_id}</td>
<td>{cycle id=$cycle_id}</td>
</tr>
{/section}
</table>
sadly, the output looks like:
Accommodation Accommodation
Business Business
Computers Computers
Careers Careers
Education Education
how do i correct this. greatly appreciate your advice.
rgds
--
jkpsj
__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com