php打开文件写入数据 php写入文件内容( 三 )


?
?php
static $connect = null;
static $table = 'jilian';
if(!isset($connect)) {
$connect = mysql_connect("localhost","root","");
if(!$connect) {
$connect = mysql_connect("localhost","Zjmainstay","");
}
if(!$connect) {
die('Can not connect to database.Fatal error handle by /test/db.php');
}
mysql_select_db("test",$connect);
mysql_query("SET NAMES utf8",$connect);
$conn = $connect;
$db = $connect;
}
?
//*/
.
-- 数据表结构:
-- 100000_insert,1000000_insert
CREATE TABLE `100000_insert` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parentid` int(11) NOT NULL,
【php打开文件写入数据 php写入文件内容】`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
100000 (10万)行插入:Insert 100000_line_data use 2.5534288883209 seconds
1000000(100万)行插入:Insert 1000000_line_data use 19.677318811417 seconds
//可能报错:MySQL server has gone away
//解决:修改my.ini/my.cnfmax_allowed_packet=20M
php打开文件写入数据的介绍就聊到这里吧 , 感谢你花时间阅读本站内容,更多关于php写入文件内容、php打开文件写入数据的信息别忘了在本站进行查找喔 。

推荐阅读