Hello everyone , Im working with a huge survey database and I was trying to make a script to see if theres any repeated row
so far all i have made is this , its kinda dump since it will return the same row it is comparing and it really doesnt check if there exist any repeatd , this script its just an idea 😛
$repeted = array();
$repeteda = array();
$gimmeall = xqry("SELECT * FROM my_table");
while($check1=mysql_fetch_array($gimmeall))
{
$dis1=$check1['name'];
$id1=$check1['id'];
$selection = xqry("SELECT * FROM my_table WHERE name LIKE '%$dis1%'");
if(mysql_affected_rows() > 0)
{
$asel = mysql_fetch_array($selection);
foreach($asel AS $lmao)
{
$id2 = $asel['id'];
$repeted[] = $id2;
$repeted[] = $id1;
}
}
}
foreach($repeted AS $lol)
{
$chec = xqry("SELECT * FROM my_table WHERE id='$lol'");
while($r=mysql_fetch_array($chec))
{
$name=$r['name'];
echo "$name <br>";
}
}