First see if you can rename the file to .php5. Many hosting companies install both PHP4 & PHP5 - and let you get to PHP5 using .php5. If that's not an option ....
It looks like it might be an SQL error, or an SQL error related to the PHP version - with the (SELECT ...) causing a problem. Try breaking the SQL into two statements or rewriting it.