PHP Classes

Bug

Recommend this page to a friend!

      Template Class  >  All threads  >  Bug  >  (Un) Subscribe thread alerts  
Subject:Bug
Summary:Has anyone tried using this inside function ?
Messages:1
Author:Emir Hadzic
Date:2008-05-02 08:25:09
 

  1. Bug   Reply   Report abuse  
Picture of Emir Hadzic 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?