SELECT
`tb_province`.`name_prov`,
`tb_areas`.`name_areas`,
`tb_temperature`.`temp_hight`,
`tb_temperature`.`date_temp`
FROM
`tb_areas`
Inner Join `tb_province` ON `tb_province`.`id_prov` = `tb_areas`.`prov`
Inner Join `tb_temperature` ON `tb_areas`.`id_areas` = `tb_temperature`.`areas`
WHERE
`tb_province`.`id_prov` = '8' AND
MONTH(tb_temperature.date_temp)='$mm' AND YEAR(tb_temperature.date_temp)='$yy'
ORDER BY
`tb_province`.`name_prov` ASC,
`tb_temperature`.`date_temp` ASC
SELECT
`tb_temperature`.`date_temp`,
`tb_temperature`.`areas`,
MAX(`tb_temperature`.`temp_hight`) as temp_hi,
`tb_temperature`.`temp_low`,
`tb_areas`.`id_areas`,
`tb_areas`.`name_areas`,
`tb_areas`.`prov`,
`tb_province`.`id_prov`,
`tb_province`.`name_prov`
FROM
`tb_temperature`
Inner Join `tb_areas` ON `tb_temperature`.`areas` = `tb_areas`.`id_areas`
Inner Join `tb_province` ON `tb_province`.`id_prov` = `tb_areas`.`prov`
WHERE
MONTH(tb_temperature.date_temp)='$mm' AND YEAR(tb_temperature.date_temp)='$yy'
GROUP BY date_format(tb_temperature.date_temp,'%d')
ORDER BY
`tb_temperature`.`date_temp` ASC