Ive got a database that Im trying to pull data from (the name of each unique identifier and also how many times it appears in the database) by using this query:
$query = "SELECT Dcol, COUNT(*) FROM dtest GROUP BY Dcol";
and then using this to actually print the data out:
while($result->fetch_row()){
$row = $result->fetch_array(MYSQLI_NUM);
printf("<strong>%s</strong> : <i>%s</i><br />",$row[0],$row[1]);
}
and it works great except for the fact that it only gets 2 of the 4 unique items from the Dcol column. I've tested it by just putting everything that the fetch_row() returns into an array and then using print_r and when I do that it actually shows all 4 with the correct number of times it was used, but when I try to print it using the above statement I get 2 of the 4 (the second and fourth one, if that helps at all)
Can anyone tell me why this would only be giving two of the four unique items?