puck916
04-25-2007, 06:33 PM
I have a hook like below:
<?
$server = "localhost";
$database = "voice";
$server = "localhost";
$user = "root";
$password = "";
$dborig = mysql_connect($server,$user,$password);
mysql_select_db($database,$dborig);
$stats = array();
$sql = "SELECT COUNT(*) as count FROM account";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if($row){
$stats["registered"] = $row['count'];
$registeredusers = $row['count'];
}
mysql_close($dborig);
?>
I want in my header template to either be able to put $registeredusers or $stats['registered'] and have it display the result.
How can I do this. I have my hook running successfully. I just cant figure out how to get the template var replaced.
Thanks
nobody?
<?
$server = "localhost";
$database = "voice";
$server = "localhost";
$user = "root";
$password = "";
$dborig = mysql_connect($server,$user,$password);
mysql_select_db($database,$dborig);
$stats = array();
$sql = "SELECT COUNT(*) as count FROM account";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if($row){
$stats["registered"] = $row['count'];
$registeredusers = $row['count'];
}
mysql_close($dborig);
?>
I want in my header template to either be able to put $registeredusers or $stats['registered'] and have it display the result.
How can I do this. I have my hook running successfully. I just cant figure out how to get the template var replaced.
Thanks
nobody?