I worked on some code for fetching the values and count the times who appears in the query.
But, for some strange thing, don''t work as I wanted, can someone explain me why and why I need to do?
$query2 = mysql_query("select $columns from $database where Categoria = '$Categ' and Provincia = '$Provs' order by $param $orden");
$rows = mysql_num_rows($query2);
$maxregs = $rows*5;
echo $maxregs;
while ($fila=mysql_fetch_array($query2,MYSQL_NUM))
{
reset($fila);
rsort($fila);
reset($fila);
$fila2 = array_count_values($fila);
reset($fila2);
rsort($fila2);
reset($fila2);
$c_key=0;
// for some weird cause I need to divide by 2 the number of maxregs
while($c_key <= $maxregs/2) {
// if the value is zero, don't display it
if ($fila2[$c_key] > 0) {
echo"Valor guardado ";
print key($fila2);
echo " - ";
print $fila2[$c_key];
echo "<BR>";
}
$c_key++;
}