This is a question concerning a solutions provided by @Blaatpraat which solved that part of my issue.
I now have an array which contains:
Array ( [NXLHR01011474021550] =>
Array ( [UniqueID] => NXLHR01011474021550 [Room] => 0101 [AuditBy] => navexdemo2 [AuditDate] => 2016-09-16 11:26:00 [SeqID] => SeqID1306 [Status] => 1 [WaterHot] => 67.0 [WaterCold] => 18.0 )
[NXLHR01021474021587] =>
Array ( [UniqueID] => NXLHR01021474021587 [Room] => 0102 [AuditBy] => navexdemo2 [AuditDate] => 2016-09-16 11:26:00 [SeqID] => SeqID1306 [Status] => 0 [WaterHot] => 65.0 [WaterCold] => 21.0 )
)
I am now tring to display each record in the array row by row.
My code is;
foreach ($array as $key => $item) {
echo $array[$row['UniqueID']]['Room']."\n";
echo $array[$row['UniqueID']]['AuditBy']."\n";
echo $array[$row['UniqueID']]['WaterHot']."\n";
echo $array[$row['UniqueID']]['WaterCold']."\n";
}
But the result is: "0102 navexdemo2 65.0 21.0" "0102 navexdemo2 65.0 21.0" the same record twice.
Does anyone know why the first record in the array is not displayed.
I have had a lot of help from members and I was trying to avoid asking for help but I have tried so many ways to get this to work without success.
Again, I thank you for your time.
$row['UniqueID']is always the sameforeachit is always the same.UniqueIDis a key if$item, not$row.$iteminstead of$rowinside the loop, is that I think what @u_mulder is saying.