Re: Keeping Mears in Database
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2003-04-07 21:13:06
|
Klaus Dahlke <kla...@gm...> writes: > I tried in the first place to extend the key and change > 'update-metar' to 'insert_metar', but as the timestamp is the time > of the metar, the system get still confused and reports 'duplicate > entry'. If you relax your demands on the keys in the database, and then make update_metar call insert_metar, then it's easy to put the same row into the database several times. With no indexes at all, or just a normal index on the icao and perhaps also on timestamp I get lots of METARs into the database. The problem is that I get three new rows each time someone submits a station(!) I think it's a problem with the logic in data_retrieval.php. The get_metar_from_web() function retrieves a METAR from NWS and tries to adjust the timestamp in a clever way if it think's it's too old. I've not looked into it, but I think it must be there the problem lies. If we're going to do this right, then there should be some support for deleting old contents, support for selecting old reports and the logic should be updated. It sure would be cool to have a fourth drop-down box where people could select a different data to see data from, or even to generate graphs that show the tendency over the last day/week/month... Klaus, if you want to work on this, then let me know and I can add you to the project --- this project really needs someone who can put some energy into it. Just create an account at SourceForge and mail me the account name and I'll setup the CVS write permissions for you. -- Martin Geisler My GnuPG Key: 0xF7F6B57B See http://gimpster.com/ and http://phpweather.net/ for: PHP Weather: Shows the current weather on your webpage and PHP Shell: A telnet-connection (almost :-) in a PHP page. Join Freenet: http://gimpster.com/downloads/freenet/ |