|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mymaterick Smarty n00b
Joined: 21 Oct 2011 Posts: 3
|
Posted: Fri Oct 21, 2011 6:54 am Post subject: Sort alphabetically |
|
|
Hi i want to sort the results from this code
{if $smarty.foreach.ListFeatureFlorist.iteration % 3 == 0}</tr>
<tr>{/if}
{/foreach}
at the moment they come up in a random order, i assume based on where they ly in the database.
New at this so any help is greatly received.
Cheers
Rick |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Fri Oct 21, 2011 10:06 am Post subject: Re: Sort alphabetically |
|
|
mymaterick wrote: | Hi i want to sort the results from this code
{if $smarty.foreach.ListFeatureFlorist.iteration % 3 == 0}</tr>
<tr>{/if}
{/foreach}
at the moment they come up in a random order, i assume based on where they ly in the database.
New at this so any help is greatly received.
Cheers
Rick |
In order, best option first:
1) sort the results coming from the database using SQL.
2) Sort the results in PHP
3) Build a plugin to sort |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
|
Back to top |
|
mymaterick Smarty n00b
Joined: 21 Oct 2011 Posts: 3
|
Posted: Fri Oct 21, 2011 6:30 pm Post subject: |
|
|
thanks douglassdavis
I did it in SQL, with - order by
lesson well learnt |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|