php 删除mysql数据库的重复记录
span style=color:#333333;font-family:Arial;font-size:14px;line-height:21px;利用新建一个表,直接把不重复的数据导入.br / 转载:/span a href=http://www.tongqiong.com/read.php?tid-9.html rel=nofollowhttp://www.tongqiong.com/rea
利用新建一个表,直接把不重复的数据导入.
转载: http://www.tongqiong.com/read.php?tid-9.html
转载: http://www.tongqiong.com/read.php?tid-9.html
<?php
//作者:www.tongqiong.com
set_time_limit(13600); //设置时间
$conn=mysql_connect('localhost','root',''); //连接数据库
mysql_select_db('shuju',$conn);
mysql_query("set names 'gbk'");
$query = mysql_query("select min(id) as mid from taobaoguanjianci group by title");
while($row = mysql_fetch_array($query))
{
mysql_query("INSERT into taobaoguanjiancitmp select id,cid,title,cat,level3,cname from taobaoguanjianci where id=$row[mid]");
}
//作者:www.tongqiong.com
?>
- 上一篇:php简单的数组递归
- 下一篇:php逐行读取txt并导入数据库
精彩图集
精彩文章






