Může to být tím, že chybí závorky. Zabalte between
podmínky pomocí závorek
$query = "SELECT *
FROM earthquakes
WHERE (milliseconds BETWEEN `$ieri` AND `$oggi`)
AND (magnitude BETWEEN `$magn_min` AND `$magn_max`)
AND (ipocentro BETWEEN `$ipo_min` AND `$ipo_max`)
OFFSET $offset LIMIT 400";
$n_quakes = "SELECT COUNT(*)
FROM earthquakes
WHERE (milliseconds BETWEEN `$ieri` AND `$oggi`)
AND (magnitude BETWEEN `$magn`_min AND `$magn_max`)
AND (ipocentro BETWEEN `$ipo_min` AND `$ipo_max`)
AND (latitude BETWEEN `$lat_inf` AND `$lat_sup`)
AND (longitude BETWEEN `$lng_sin` AND `$lng_des`)";