Hello!
Please have a look at the following sample code and help me out if you can
$db = new db_SQL();
$sql = "SELECT Name, Email FROM whatever WHERE whatever=whatever";
$db->query( $sql );
while ($db->next_record())
{
//This is my first array
$foo[] = array ("name"=>$db->f("Name"), "email"=>$db->f("Email"));
}
$db2 = new db_SQL();
$sql2 = "SELECT Name, Email FROM another_table WHERE foo=bar";
$db2->query( $sql2 );
while ($db2->next_record())
{
//This is my second array
$bar[] = array ("name"=>$db2->f("Name"), "email"=>$db2->f("Email"));
}
// Now i want to compare the two arrays
$diff = array_diff($foo[0], $bar[0]);
//And heres where it stops working as it should
foreach ($diff as $element)
{
echo $element."<br>";
}
What is driving me crazy since more then 7 hours is that it ($element) will
only output ONE difference, but i want ALL differences listed, why is this
not working?
As far as i know i am doing nothing wrong, or am i totally stupid?
Thank you very much in advance for your time and help!
Best regards from Vienna,
Jürgen