Re: [SMARTY] Loop with section sentence
| From: | messju mohr | Date: | Tue, 05 Apr 2005 07:31:13 +0000 |
| Subject: | Re: [SMARTY] Loop with section sentence | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12402@lists.php.net to get a copy of this message | ||
On Tue, Apr 05, 2005 at 05:14:22AM +0200, Reynier Pérez Mira wrote:
> Well list:
> I new in the world of Smarty. I have this pages:
> objetives.php and objetives.tpl. This is a part of
> code in wich I try to return element contains in a
> database:
> // previously I construct a object from AdoDB Class
> $objeres = $database->Execute('SELECT * FROM
> objetivos');
> $objnrows = $objeres->RecordCount();
> in this code how I return a value contain in a fields,
> something like
> while($row = mysql_fetch_array($objres));
>
> and this is a part of objetives.tpl in wich I try to
> show data obtain in previously query.
> <section name=objRes loop=$objnrows>
> <tr>
> <td width="3%"><$objnrows[objRes][0]></td>
> <td width="97%"><$objnrows[objRes][1]></td>
> </tr>
> </section>
> but the page show me this code in:
> <$objnrows[objRes][0]>
> <$objnrows[objRes][1]>
> what's wrong in this code? Help Me please?
Smarty tag-delimiters are { and }, not < and >. so your lines should read:
<td width="3%">{$objnrows[objRes][0]}</td>
<td width="97%">{$objnrows[objRes][1]}</td>
I suggest you read the spanish manual at
http://smarty.php.net/manual/es/
and come back if questions are still open after that
greetings
messju
> Regards
> PD: Soury my English but I not speak much them my
> language is spanhis.
>
> Reynier Pérez MiraBlog de ReynierPM