drslez4322 2011-08-06 08:57
浏览 3
已采纳

如何在php中找到mysql中一个字段的真实表名?

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.

  • 写回答

1条回答 默认 最新

  • duanjizhan9353 2011-08-06 09:04
    关注

    You could parse the query, as one commenter of the php.net documentation suggests.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?