RE: [SMARTY] Problem with (unlimited) amounts of data IN an array

From: Date: Sun, 11 Aug 2002 09:37:35 +0000
Subject: RE: [SMARTY] Problem with (unlimited) amounts of data IN an array
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5648@lists.php.net to get a copy of this message
Yes, i already tried that solution (and it worked!), but I think it's better to do it in 2 queries to reduce the redundant information. So if someone has already done this before on my method (or has a better method :)), please give me a note. Thanks, Peter -----Original Message----- From: Bob Silva [mailto:bob@bravenet.com] Sent: zondag 11 augustus 2002 8:53 To: peter@clueless.be; smarty-general@lists.php.net Subject: Re: [SMARTY] Problem with (unlimited) amounts of data IN an array I'd offer something like this....its a little heavy due to the redundant data on the join but it does solve the issue: "select * from omg_leaguelist left join omg_wars using(league_id) left join omg_clanlist using(clan_id) order by league_name" This brings in all your data for each league into one array you can iterate cleanly. while ($row = $db->fetch_array($res)) { $data[$row['league_id']][] = $row; } $t->assign('data', $data); Then loop the array within the template.... foreach $leagueid { echo 'League stuff'; foreach $data[$league_id] { echo 'War stuff for each league'; } } Bob Silva ----- Original Message ----- From: "Peter Billen" <peter@clueless.be> To: <smarty-general@lists.php.net> Sent: Saturday, August 10, 2002 2:46 PM Subject: [SMARTY] Problem with (unlimited) amounts of data IN an array > Hi, > > I got this error: > <smarty-general@lists.php.net>: > ezmlm-reject: fatal: Sorry, I don't accept messages larger than 30000 > bytes (#5.2.3) > > So I uploaded my question. You can find it here: > http://www.clueless.be/arrays.htm > > Thanks, > > Peter >

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