|
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 |
tubba Smarty n00b
Joined: 04 May 2015 Posts: 1
|
Posted: Mon May 04, 2015 2:41 pm Post subject: Show last 5 results - foreach |
|
|
Hi guys,
I am creating a table with foreach but I just want only five last results from this array:
Code: | {foreach from=$bid_history item=bid name=bids}
{assign var="tr_class" value=""}
{if $bid->userid==$userid}
{assign var="tr_class" value="auction_bids_mybid1"}
<a name = 'mybid' id = 'mybid'></a>
{/if}
{if $bid->accept}
{assign var="tr_class" value="auction_winner"}
{/if}
<tr class = "{cycle values=auction_bids_list1,auction_bids_list2} {$tr_class}">
<td class = "hidden-phone">{$smarty.foreach.bids.iteration}</td> |
Any clues?
THANKS! |
|
Back to top |
|
thiebo Smarty Pro
Joined: 16 Jan 2005 Posts: 144 Location: Paris
|
Posted: Mon May 04, 2015 3:25 pm Post subject: |
|
|
changing your mysql request .... ? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon May 04, 2015 4:27 pm Post subject: |
|
|
thiebo wrote: | changing your mysql request .... ? |
Basically this. |
|
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
|