[eluser]Conerck[/eluser]
[quote author="OverZealous" date="1265133095"]Well, I'll keep thinking about it.[/quote]
I just ran into the same problem as mrtavo and it seems to apply to all _func() calls where the SQL Function has more than 1 parameter.
I tracked the problem down to CodeIgniter's ActiveRecord. In the select() function CI splits the passed select arguement with
Code:
$select = explode(',', $select)
(DB_active_record.php @ l 83)
which hacks up the multi-argument SQL function into seperate select fields as far as CI is concerned (This is kinda ugly, but not exactly the source of the problem).
Then when you call get() later, CI goes ahead and calls protect_identifiers on every field again (in _compile_select(), l. 1511), which causes the Syntax errors.
So, the problem is that protect_identifers is only temporarily disabled by DMZ during the select_func() call, it is turned back on before get() is called.
You'd have to keep protect_identifiers set to FALSE until after the query has been completed.
Since I don't know the inner workings of DMZ too well I didn't attempt to make a patch for it, since I don't know what side effects this could cause, but I hope I could help you with tracking down the problem.