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

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

WBOY
WBOYOriginal
2016-06-13 12:45:40894browse

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

<?php<br />
	$link=mysql_connect('localhost','root','qnmlgb')or die('error');<br />
	mysql_select_db('sql',$link);<br />
	mysql_query('set names utf8;');<br />
	$jks='新的字段表';<br />
	for($i=1;$i<10000; $i++ ){<br />
	<br />
	echo $i.'<br>';<br />
	mysql_query("insert into `name` values('$i','$jks')");<br />
		}<br />
mysql_close($link);


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

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

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


请问下这样的情况是为什么呢

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