Fatal Error when enter to FreePBX Administration

I’ve installed FreePBX 2.3.0 sucessfully in Debian Sarge with Asterisk 1.4.11 and Mysql 4.0.24
but when I enter to the option ->FreePBX Administration
I get the FATAL ERROR:

FATAL ERROR:
SELECT t.variable, t.value, d.value state FROM globals t JOIN (SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE ‘OUTDISABLE\%’) d ON substring(t.variable,5) = substring(d.variable,12) WHERE t.variable LIKE 'OUT\%’ UNION ALL SELECT v.variable, v.value, concat(substring(v.value,1,0),‘off’) state FROM globals v WHERE v.variable LIKE ‘OUT\%’ AND concat('OUTDISABLE’,substring(v.variable,5)) NOT IN ( SELECT variable from globals WHERE variable LIKE ‘OUTDISABLE\_%’ ) ORDER BY RIGHT( variable, LENGTH( variable ) - 4 )+0 [nativecode=1064 ** You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE]

For some help, Thanks in advance!!!

I found a solution but I think it is not the best solution and I don’t undestand what this code really do
if someone could explain me.
I commented these lines in /var/www/admin/modules/core/functions.inc.php and added the last line and this solve the problem.
//$sqlstr = "SELECT t.variable, t.value, d.value state FROM globals t ";
//$sqlstr .= "JOIN (SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE ‘OUTDISABLE_%’) d ";
//$sqlstr .= "ON substring(t.variable,5) = substring(d.variable,12) WHERE t.variable LIKE ‘OUT_%’ ";
//$sqlstr .= "UNION ALL ";
//$sqlstr .= "SELECT v.variable, v.value, concat(substring(v.value,1,0),‘off’) state FROM globals v ";
//$sqlstr .= "WHERE v.variable LIKE ‘OUT_%’ AND concat(‘OUTDISABLE_’,substring(v.variable,5)) NOT IN ";
//$sqlstr .= " ( SELECT variable from globals WHERE variable LIKE ‘OUTDISABLE_%’ ) ";
//$sqlstr .= “ORDER BY RIGHT( variable, LENGTH( variable ) - 4 )+0”;

            //$unique_trunks = sql("SELECT * FROM globals WHERE variable LIKE 'OUT\\\_%' ORDER BY RIGHT( variable, LENGTH( variable ) - 4 )+0","getAll");
            //$unique_trunks = sql($sqlstr,"getAll");

            $unique_trunks = 0;

You don’t want to comment it out. That query should run fine, it’s running on mysql 4.1.12 in one installation that I just checked. Try updating mysql.

Philippe Lindheimer - FreePBX Project Lead
http//freepbx.org - IRC #freepbx

I just want to tell you thanks for your answer.
I going to continue working with this commented, because I have some others aplications and I don’t want to have others problems
Thanks!!!