Attila Posztos - 2009-02-03 15:41:48
This seems to be a nice and good class, exactly the thing i need now. However i have 2 issues, a lighweight, and a pretty ugly one.
First the leight one: i prefer error_reporting(E_ALL) setting, and that way it spits a lot of undefined variable/index notices ($lr, $_tree['_a'], $_tree['_z'])
And the uglier: add some parenthesis to yout simple query example:
SELECT field1, field2 FROM table WHERE field3='val1' AND (field4=5 OR field5='val2')
and you'll get a bit messed up tree:
[code]
Array
(
[SQL] => Array
(
[_a] => 0
[_z] => 85
[SELECT] => Array
(
[FROM] => Array
(
[TABLE] => table
)
[WHERE] => Array
(
[0|*AND] => Array
(
[0|!EQ] => Array
(
[FIELD] => field3
)
[1|!EQ] => Array
(
[VAL] => 'val1'
)
)
[1|*AND] => Array
(
[0|*OR] => Array
(
[0|!EQ] => Array
(
[FIELD] => field4
)
[1|!EQ] => Array
(
[FIELD] => 5 OR field5
)
[2|!EQ] => Array
(
[VAL] => 'val2'
)
)
)
)
[0|*SELECT] => Array
(
[FIELD] => field1
)
[1|*SELECT] => Array
(
[FIELD] => field2
)
)
)
)
[/code]
See that '[FIELD] => 5 OR field5' line? I think this shouldnt be this way...
Keep up the good work anyway!
Cheers!