Adding title on foreach

From: Date: Thu, 09 Feb 2006 07:34:12 +0000
Subject: Adding title on foreach
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13308@lists.php.net to get a copy of this message
I have a sql select (select * from Questions order by Group_Name) from a db which has 2 fields, namely title and questions and i have outputted it thru smarty. But, i want to add the title like this Accounting: Vendors Account Version | Y/N | Ratings Business Management User friendly (GUI) But, i dont know how to do it im smarty. Question Y / N Ratings Accounting | Vendors Accounting version YESNO 1234 5 Accounting | Interface to other programs - Vendor Programming YESNO 12345 Accounting | Interface to other programs - RPC Programming YESNO 12345 Accounting | User Friendly YESNO 12345 Business Management | User friendly (GUI) YESNO 12345 Business Management | Allow RPC to access data to create custom reports YESNO 12345 Business Management | Export Excel YESNO 12345 Business Management | Export MS products YESNO 12345 Business Management | Layout/readability of static reports YESNO 12345 Here's my code. <table width=100% cellspacing=0 cellpadding=0 border=0> > > <tr class="title"> > <td>Question</td> > <td>Y / N</td> > <td>Ratings</td> > </tr> > > {foreach from=$data item="entry"} > > <tr> > <td>{$entry.1|escape} | {$entry.2|escape}</td> > > {if $entry.3 eq "Yes"} > <td colspan=2><input type="text" > name=""></td> > {else} > <td> > <select> > <option>YES</option> > <option>NO</option> > </select> > </td> > <td> > <select> > <option>1</option> > <option>2</option> > <option>3</option> > <option>4</option> > <option>5</option> > </select> > </td> > > {/if} > > </tr> > <tr> > <td height=1 bgcolor=#000000 colspan=3></td> > </tr> > {foreachelse} > <tr> > <td>No records</td> > </tr> > {/foreach} > > </table> > How can i filter this on smarty? Please help! I desperatly need this to work. -- Louie Miranda (lmiranda@gmail.com) http://www.axishift.com //JSM-W

« previous php.smarty.general (#13308) next »