I have this query in my PHP code:
SELECT usr.user_id,online.online_totime
FROM users AS usr
LEFT JOIN online_users AS online ON online.online_user=usr.user_id
I want to find tables in this query with PHP. I use mysql_field_table and it returns “usr” and “online” as table names: those are not the real names. How I can find real table names of fields?
This query only is an example. Please don’t advise me not to use AS synonym.
You could parse the query, as one commenter of the php.net documentation suggests.