-1

At the moment I am creating a Membership Site. When a member login to the site:

Account Number:
Password:

Automatically the account of the member will display. I am currently on this but I have a problem. I am trying to connect to 2 tables on the same instance of MySQL from 1 PHP script. This table is relational in one database.

Any other ideas?

4

1 回答 1

1

如果表在同一个数据库中,则只需使用JOIN运算符。

如果表在不同的数据库中,那么您可以执行以下操作:

SELECT t1.fieldname1, t2.fieldname2
FROM `database1`.`table1` t1
JOIN `database2`.`table2` t2 on (...)
WHERE ...

当然,对于数据库和表,您必须具有相应的访问权限。

于 2013-08-22T02:36:12.767 回答