What is this syntax error?

Hey,

I have the following class:


<?php

class Gallery{
	    
    public function selectGalleryCategories(){

        $sql = "SELECT * FROM tbl_gallerycategories";
        $result = mysql_query($sql);
        return $result;
    }
}

When i try using “include(‘classes/Galleries.class.php’);” i get an error:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /homepages/27/d208312252/htdocs/fusion/admin/classes/Galleries.class.php on line 5

Line 5 is this:

public function selectGalleryCategories(){

Any idea what the problem is?

Thanks

Thanks,

Thats exactly what the problem was, i added this line to my .htacces file:

AddType x-mapp-php5 .php .php4

And it now works :wink:

Thanks

The syntax error is due to PHP4 not understanding the public/private/protected visibility declarations.

You’ll need to either upgrade to using PHP5, or rewrite the code so that it doesn’t use any PHP5 features in this case that means removing the public/private/protected visibility declarations.

what version of php? does it work without the public keyword?