Re: .. still learning.. smarty, mysql results array

From: Date: Fri, 19 Apr 2002 18:41:19 +0000
Subject: Re: .. still learning.. smarty, mysql results array
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3818@lists.php.net to get a copy of this message
"Blue Presley" <blue928@carolina.rr.com> schrieb: You do a loop on $idscats. So what do you expect from $postdate, $adtitle,... ? And what value the heck should $postdate contain? I can't find antyhing for this in your query... Try this section: {section name=searchresults loop=$idscats} <tr> <td width="25%" height="30">{$idscats[searchresults].adid}</td> <td width="25%" >{$idscatse[searchresults].adtitle}</td> <td width="25%" >{$idscats[searchresults].location}</td> <td width="25%" >{$idscats[searchresults].companyname}</td> </tr> {/section} Generally it's this simple: The containervar leads ($container). Put the index of a section always in []-brackets ($container[index]). To get a specific key, just call it ($container[index].key). You can do so through several sections (means array-levels) like this: {section name=index1 loop=$container} {section name=index2 loop=$container[index1].key1} {section name=index3 loop=$container[index1].key1[index2].key2} $container[index1].key1[index2].key2[index3].key3 {/section} {/section} {/section} Like i told you before, and now once again: Monte and Andrei do a lot of work to serve easy understandable, valuable docs with smarty. So, WHY THE HELL DON'T YOU READ THEM? This way you will never get on it... Norbert

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