Recommend this page to a friend! |
SQL Parse Convert to Tree Array | > | All threads | > | SELECT Fields problem | > | (Un) Subscribe thread alerts |
|
grek - 2011-04-07 11:18:03
Problem is here - each main types like FROM , WHERE is in self tree , but SELECT not look bootm this message - when i want get - what this query select i must parse main tree can you change it ?
or how to change it ? example - better way : ( [SQL] => Array ( [_a] => 0 [_z] => 134 [SELECT] => Array ( [FROM] => Array() [WHERE] => Array() [SELECT] => Array() current way ( [SQL] => Array ( [_a] => 0 [_z] => 134 [SELECT] => Array ( [FROM] => Array() [WHERE] => Array() [0|*SELECT] => one row [1|*SELECT] => one row [2|*SELECT] => one row for query : SqlRes select aaa,bb as bbb2,ccc as ccc2 FROM table left join otherTable as ddd on aaa=ccc where bbb=ccc and aaa=ddd order by aaa limit 10,10 i get : Array ( [SQL] => Array ( [_a] => 0 [_z] => 134 [SELECT] => Array ( [FROM] => Array ( [0|*JOIN] => Array ( [TABLE] => table ) [1|*JOIN] => Array ( [0|*ON] => Array ( [0|*AS] => Array ( [left] => left [TABLE] => otherTable ) [1|*AS] => Array ( [TABLE] => ddd ) ) [1|*ON] => Array ( [0|!EQ] => Array ( [FIELD] => aaa ) [1|!EQ] => Array ( [FIELD] => ccc ) ) ) ) [WHERE] => Array ( [0|*AND] => Array ( [0|!EQ] => Array ( [FIELD] => bbb ) [1|!EQ] => Array ( [FIELD] => ccc ) ) [1|*AND] => Array ( [0|!EQ] => Array ( [FIELD] => aaa ) [1|!EQ] => Array ( [FIELD] => ddd ) ) ) [ORDER] => Array ( [FIELD] => aaa ) [LIMIT] => Array ( [0|*LIMIT] => Array ( [VAL] => 10 ) [1|*LIMIT] => Array ( [VAL] => 10 ) ) [0|*SELECT] => Array ( [FIELD] => aaa ) [1|*SELECT] => Array ( [0|*AS] => Array ( [FIELD] => bb ) [1|*AS] => Array ( [FIELD] => bbb2 ) ) [2|*SELECT] => Array ( [0|*AS] => Array ( [FIELD] => ccc ) [1|*AS] => Array ( [FIELD] => ccc2 ) ) ) ) ) |
info at phpclasses dot org
.