So I have this array:
I don't know if it's clear, but there are alot of elemenst in this array that have the same name, I want to count this elements and show it, this is how I create the array:
foreach ($rowa as $rowsa)
{
$sql = "SELECT count(*) as NUMBER FROM BANDZENDINGEN WHERE FB_AFGESLOTEN = 'F' AND FB_AKTIEF = 'T' AND FI_AFVOERKANAAL = 1 AND FI_RAYONID = $rowsa AND FI_VERRIJKINGID < 1;";
$sfh = $dbh->prepare($sql);
$sfh->execute();
$row = $sfh->fetchAll(PDO::FETCH_COLUMN, 0);
array_push($row, $rows['FC_RAYON']);
print_r($row);
}
I already have tried this:
count of duplicate elements in an array in php
This anwser doesn't seem to work for me, but maybe I am doing something wrong.
btw $rows['FC_RAYON'] is from another query, it's not relevant to this question, but if you want to see it I will edit my post to show it.
So must I do? could you please help.
EDIT
better look at the array:
Array ( [0] => 2 [1] => RT-SCB-PB01 )
Array ( [0] => 0 [1] => RT-SCB-PB01 )
Array ( [0] => 3 [1] => RT-SCB-PB01 )
Array ( [0] => 1 [1] => ASDC-PBSN )
Array ( [0] => 0 [1] => ASDC-PBSN )
Array ( [0] => 0 [1] => ASDC-PBSN )
Array ( [0] => 0 [1] => ASDC-PBSN )
Array ( [0] => 1 [1] => ASDW-PBSN )
This is a very small part of the array.
EDIT 2
Array
(
[0] => 2
[1] => RT-SCB-PB01
)
Array
(
[0] => 2
[1] => RT-SCB-PB01
)
Array
(
[0] => 1
[1] => RT-SCB-PB01
)
Array
(
[0] => 3
[1] => RT-SCB-PB01
)
Array
(
[0] => 2
[1] => ASDC-PBSN
)
Array
(
[0] => 2
[1] => ASDC-PBSN
)
Array
(
[0] => 1
[1] => ASDC-PBSN
)
Array
(
[0] => 1
[1] => ASDW-PBSN
)
Array
(
[0] => 0
[1] => ASDW-PBSN
)
Array
(
[0] => 0
[1] => ASDW-PBSN
)
so this is here is an even beter look at the array, the data in the array is diffrent because it's is a very actief database
EDIT 3
if your intersted this is my entire result you can see it here:
https://mega.nz/#!uvpBWSoL!V6xYCuJ5mCWwiYqnoaz6LiYynioCylWDxPYioV_9qpo
open with paint
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…