Problem calling my own php file with callback

omoe

Member
Im trying to run the following

Code:
<?php
class Attachments_Sum{
    public static function getHtml(){
$conn_error = 'A problem has occured ,Please report it directly to the website developer ';
$mysql_host = '******';
$mysql_user = '******';
$mysql_pass = '******';
$mysql_db = '******';
if (!@mysql_connect($mysql_host, $mysql_user, $mysql_pass)|| !@mysql_select_db($mysql_db)) {die($conn_error);}
$query = @mysql_query("SELECT SUM(`view_count`) FROM `xf_attachment`");
$totaldownloads=@mysql_result($query,0);
return $totaldownloads;

     }
}

?>

The callback
<xen:callback class="Attachments_Sum" method="getHtml"></xen:callback>

the php file is stored in Library/Attachments/Sum.php

The error i keep on getting is

Parse error: syntax error, unexpected '}' in /home/admin/public_html/library/Attachments/Sum.php on line 17
 
Top Bottom