hello i have a select query in which after i put
$res = $db-> query ($query);
i have the following commands
$num = mysqli_num_rows($res);
$row = mysqli_fetch_row($res);
$cols = count($row);
i want to count how many times the values in the returned array exist
i use array_count_values().
although it works for this test array
$t = array (4,5,1,2,3,1,2,1,4,5,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
$A = array_count_values($t);
$len2 = count($t);
for ($i = 0; $i < $len2; $i++)
{
echo $A[$i];
echo '<br>';
}
it doesnt work for this one
$B = array_count_values($row);
$len = count($row);
isnt the $row an array that holds the rows returned from the query?
thank u