<?
session_start();
 include("../../test.php");
 include ("../../opendb.php");

$sql="select msno,count(msno),brcode from minput group by msno having count(msno)>1";
$re=mysqli_query($db,$sql) or die(mysqli_error($db));
 print "<font color=red> Duplicate msno found</font> <br>";
if(mysqli_num_rows($re)>0)
{
print "<table><th>msno <th>Count<th>Branch";
while($row=mysqli_fetch_array($re))
{
 print "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td></tr>";
$sql="delete from minput where msno='$row[0]' limit 1";
print $sql;
$re=mysqli_query($db,$sql) or die(mysqli_error($db));

}
print "</table>";
}
?>
