Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
同时连接wordpress数据库和我自己的mysql数据库_Mysql_Wordpress_Connection - Fatal编程技术网

同时连接wordpress数据库和我自己的mysql数据库

同时连接wordpress数据库和我自己的mysql数据库,mysql,wordpress,connection,Mysql,Wordpress,Connection,我有一个网站,我正在建设,混合wordpress和我自己的设计在一起。有些部分将有一个使用自定义主题的完整wordpress页面,而另一些部分将是我的php站点,其中只有一部分文章将从wordpress数据库中提取出来。我遇到的问题是,当我通过包含wp-blog-header.php连接到wordpress时,我无法连接到自己的自定义MySQL数据库。如何同时保持与两个数据库的活动连接?我不确定wp-blog-header.php中有什么内容,但我猜您需要更明确地管理与mysql的连接 mysq

我有一个网站,我正在建设,混合wordpress和我自己的设计在一起。有些部分将有一个使用自定义主题的完整wordpress页面,而另一些部分将是我的php站点,其中只有一部分文章将从wordpress数据库中提取出来。我遇到的问题是,当我通过包含wp-blog-header.php连接到wordpress时,我无法连接到自己的自定义MySQL数据库。如何同时保持与两个数据库的活动连接?

我不确定wp-blog-header.php中有什么内容,但我猜您需要更明确地管理与mysql的连接


mysql\u connect返回一个资源句柄,您应该能够对每个数据库使用它一次,并使用适当的资源句柄存储这些资源句柄。wordpress站点的数据库连接凭据将在wp-config.php中,只需将它们作为mysql\u connect的参数插入即可。

这对我没有任何帮助。