PHP-SQL-Parser
PHP-SQL-Parser copied to clipboard
Tables in FROM surrounded by back-ticks are parsed with backticks
SELECT * FROM `asdf`, qwer;
In above, tables are parsed as-
`asdf`
qwer
Pretty sure this is as expected, and similar to how quotes are handled elsewhere. Check the [no_quotes][parts] array for the "real" name:
[FROM] => Array
(
[0] => Array
(
[expr_type] => table
[table] => `asdf`
[no_quotes] => Array
(
[delim] =>
[parts] => Array
(
[0] => asdf
)
)
[alias] =>
[hints] =>
[join_type] => JOIN
[ref_type] =>
[ref_clause] =>
[base_expr] => `asdf`
[sub_tree] =>
)
[1] => Array
(
[expr_type] => table
[table] => qwer
[no_quotes] => Array
(
[delim] =>
[parts] => Array
(
[0] => qwer
)
)
[alias] =>
[hints] =>
[join_type] => CROSS
[ref_type] =>
[ref_clause] =>
[base_expr] => qwer
[sub_tree] =>
)
)