SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Jul 12, 2009, 12:19 #1
- Join Date
- Oct 2004
- Location
- uk
- Posts
- 853
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Pass variable along with array to smarty
Hi guys
PHP Code:$iCurrent = time();
for($iDays = 1; $iDays <= 60; $iDays++)
{
$thedate = date('Y-m-d 00:00:00', $iCurrent += 86400);
$sql = mysql_query("SELECT * FROM dates WHERE Start='$thedate' ");
$number = mysql_num_rows($result);
$temp_array[] = date('D M dS, Y', $iCurrent += 86400),;
}
$smarty->assign("array",$temp_array);
$smarty->display("chooseday.tpl");
}
How can I pass $number along with the array ($temp_array[] ) to smarty?
Regards
Chris
-
Jul 12, 2009, 13:04 #2
- Join Date
- Jul 2009
- Posts
- 6
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try adding these two lines:
$smarty->assign("number",$number);
$smarty->display("chooseday.tpl");
I would not add number to the array[] assuming that array will all be displayed, which I do not think you want to happen.
Bookmarks