|
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 |
furious5 Smarty Rookie
Joined: 06 Sep 2004 Posts: 16
|
|
Back to top |
|
furious5 Smarty Rookie
Joined: 06 Sep 2004 Posts: 16
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Oct 15, 2004 1:10 pm Post subject: |
|
|
you actually don't seem to fill $test with anyting on the php-side. |
|
Back to top |
|
furious5 Smarty Rookie
Joined: 06 Sep 2004 Posts: 16
|
Posted: Mon Oct 18, 2004 8:39 am Post subject: |
|
|
Hmm yes, I do see your point.
Even if I change the code to this:
Code: |
if($num_rows > 0)
{
$smarty->assign_by_ref("test", $row);
}
|
When I run SMARTY Debug I can not see the variable.
If I include the module within the index.php I can get the array I'm passing, so somewhere along the way I must be missing something fairly fundamental. Any ideas, anyone??
________
Bandit Series
Last edited by furious5 on Tue Feb 01, 2011 2:28 am; edited 2 times in total |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Oct 18, 2004 10:25 am Post subject: |
|
|
Code: |
// Include Global Connection File
require_once("../config/configs/connect.php");
// Set Global Variables
global $smarty; # Smarty Object
global $test; # Events Array
// Search for events which are going to happen and display name, date and location
$sql = "SELECT * FROM event";
$sql_result = mysql_query($sql, $link) or die(mysql_error());
if(mysql_num_rows($sql_result) > 0)
{
$test = array();
while( $row = mysql_fetch_assoc($sql_result)) {
$test[] = $row;
}
$smarty->assign("test", $test);
}
|
|
|
Back to top |
|
furious5 Smarty Rookie
Joined: 06 Sep 2004 Posts: 16
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Oct 18, 2004 2:00 pm Post subject: |
|
|
Put a {debug} into your template so you can verify the passed values. |
|
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
|