Home >Backend Development >PHP Tutorial >discuz中怎么在2个database读取数据

discuz中怎么在2个database读取数据

WBOY
WBOYOriginal
2016-06-06 20:35:511051browse

config_global.php已经写好一个dbname了,我现在要从另一个dbname中调取数据,要怎么selectdb呢?

回复内容:

config_global.php已经写好一个dbname了,我现在要从另一个dbname中调取数据,要怎么selectdb呢?

暂时目前我只能用新建视图来解决两个database之前互相读取多个tablename了

CREATE VIEW 给想要访问的tablename取的新name
AS SELECT * FROM 想要访问的database.想要访问的tablename a WHERE a.条件;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn