• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Problem calling my own php file with callback

Im trying to run the following

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`");
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