Código PHP:
function cantidadPuntos($puntuacion)
{
$query = mysql_query("SELECT ID FROM t_motivo WHERE puntuacion = '$puntuacion'");
return mysql_num_rows($query);
}
$puntuacionFinal = array();
for ($c = 0; $c <= 10; $c++)
{
$id = cantidadPuntos($c);
$puntuacionFinal[] .= $id;
if ( $puntuacionFinal[$c] != 0)
{
echo 'Puntuacion ' . $c . ': ' . $puntuacionFinal[$c] . ' Registros <br />';
}
}