MyBB Community Forums

Full Version: Modify index.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I added this code to the index.php to view a table of the tournament of JoomSport (a plugin of joomla).

$select_camp = $db->query("SELECT s_id FROM FICW_bl_seasons") or die(mysql_error());
while ($camp = $db->fetch_array($select_camp)) 
{
	$select_team = $db->query("SELECT tid, punti FROM classifica WHERE camp = $camp[s_id] ORDER BY punti DESC") or die(mysql_error());
	$classifiche .= "<table><tr><td>Team</td><td>Punti</td></tr>";
	while ($tab = $db->fetch_array($select_team))
	{
		$nome_team = $db->fetch_array($db->query("SELECT t_name FROM FICW_bl_teams WHERE id = $tab[tid]"));
		$classifiche .= "<tr><td>$nome_team[t_name]</td><td>$tab[punti]</td></tr>";
	}
	$classifiche .= "</table>";
}
global $classifiche;

I also added in the index template this
{$classifiche}

But in the index page, nothing is appeared... Why?
up please
You don't need the "global $classifiche; " part, also check where you are inserting the code, it has to be before evaluating the index template (probably last line).