When using the foreach loop for two variables in an array, the MySQL query returns the first array variable along with the second during the second loop for some strange reason. Would anyone know what the cause of this is? Does the cache need to be cleared or any variables need to be cleared?
$db_array = array($id1,$id2);
foreach ($db_array as &$db_id) {
//MySQL code here
}
unset($db_id);