<?php
	/*此文件用于检测用户重复挂Q, 并删除、更新用户挂Q数量*/

	require 'header.php 文件路径';

	$result=mysql_query('SELECT * FROM `qqlist`');
	while($row=mysql_fetch_array($result)){

		//统计用户QQ个数
		$sql = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM `qqlist` WHERE `qq`='$row[qq]'"));
		if ($sql[0] > 1){
			echo '重复QQ: '.$row ['qq'].', 所属用户: '.$row ['myqq'].'<br />';
			/*删除重复QQ号或用户*/
			mysql_query ("DELETE FROM `{$row['fwq']}` WHERE `qid`='$row[qid]' and `qq`='$row[qq]'");
			mysql_query ("DELETE FROM `qqlist` WHERE `qid`='$row[qid]' and `qq`='$row[qq]'");
		}
	}
	/*重新统计用户挂Q数量*/
	require AnYue_Root.'Cronjobs/tj.php';
?>