Emir Hadzic - 2008-05-02 08:25:10
function index() {
$musicals = array();
$query = "SELECT * FROM ...";
$_musicals = mysql_query($query);
while ($line = mysql_fetch_array($_musicals,MYSQL_ASSOC)) {
array_push($musicals,$line);
}
$tpl = new Template();
$tpl->load_file('list', 'templates/musical_reader.html');
$tpl->parse_loop('list','musicals');
$tpl->print_file('list');
}
the function above will not output any variables now parse loops. It will output html and leave all variables blank. When this code is executed without function it works perfectly.
Does anyone knows the solution?