<?php //作者:www.tongqiong.com set_time_limit(13600); //设置时间 $conn=mysql_connect('localhost','root',''); //连接数据库 mysql_select_db('tongqiong',$conn); mysql_query("SET NAMES utf8"); $fp_in = fopen('F:/sql/www.tongqiong.com.txt', "r"); while (!feof($fp_in)) { $line = fgets($fp_in); //$u=explode('# ', $line);//如果有分割 mysql_query("INSERT INTO `user` (title)VALUES('trim($line)')",$conn); } echo 'OK'; //作者:www.tongqiong.com ?>
登入後複製