PHP头条
热点:

PHP循环安插数据库为什么只是可以插入1000多条就停止了


PHP循环插入数据库为什么只是可以插入1000多条就停止了

	$link=mysql_connect('localhost','root','qnmlgb')or die('error');
mysql_select_db('sql',$link);
mysql_query('set names utf8;');
$jks='新的字段表';
for($i=1;$i<10000; $i++ ){

echo $i.'
';
mysql_query("insert into `name` values('$i','$jks')");
}
mysql_close($link);


====================

照道理应该是插入1万次才停止,但是我看数据库里面只是插入了1014就停止了,看了下ECHO的页面,出现了一个错误  

Fatal error: Maximum execution time of 30 seconds exceeded in E:\web\sql.php on line 10


请问下这样的情况是为什么呢 分享到:
------解决方案--------------------
超时了
循环前执行 set_time_limt(0);

www.phpzy.comtrue/phprm/6578.htmlTechArticlePHP循环安插数据库为什么只是可以插入1000多条就停止了 PHP循环插入数据库为什么只是可以插入1000多条就停止了 $link=mysql_connect('localhost','root','qnmlgb')ordie('error'); mysql_select_db('sql',$link)...

相关文章

相关频道:

PHP之友评论

今天推荐