0
I have this select mysql and I want to count how many records each vendor has, how could I do?
$sql_visualizacoes_telefone = "SELECT * FROM visualizacoes_telefone WHERE auxiliar_fornecedor=".$row['auxiliar']."";
$result_visualizacoes_telefone = $conn->query($sql_visualizacoes_telefone);
if ($result_visualizacoes_telefone->num_rows > 0) {
if ($row_visualizacoes_telefone["auxiliar_fornecedor"]= $row['auxiliar']){
while($row_visualizacoes_telefone = $result_visualizacoes_telefone->fetch_assoc()) {
echo $row_visualizacoes_telefone["auxiliar_fornecedor"]." ";
}
}}
Give a
count()
and group by sql, does not solve?– rray
Haven’t tried while($row_views phone = $result_views phone->fetch_assoc()) { echo $row_views phone["help_supplier"]." " ; $i[]=$row_views phone["auxiliar_supplier"]; } }} print_r ($i)
– Wagner Martins Bodyboard