Home >Backend Development >PHP Tutorial >大量操作数据库,促成页面停止运行

大量操作数据库,促成页面停止运行

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:51:19913browse

大量操作数据库,造成页面停止运行
页面上要做一个同步数据功能
有N个数据库,这些数据库中都有一张充值记录表,

需要把全部充值表同步到一个中心数据库的表上

数据库是mysql的

由于运行时间很长,前台页面运行一段时间后,就停止运行

有什么办法解决,能够把数据全部同步到数据库上。
------解决方案--------------------
直接执行 sql 指令,无需 php 程序干预
至多用 php 构造 sql 指令
------解决方案--------------------

<br />//运行超时可以如下设置<br />set_time_limit(0);<br />

------解决方案--------------------
最好直接通过sql直接执行同步到中心数据库,N多数据库,数据量少的话还行,一旦数据量大了,还是会遇到这种问题的~

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