Re: phpweather
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2004-04-29 21:15:07
|
Rory Oliver <ro...@lo...> writes: Hi Rory I've CC'ed this answer to the PhpWeather mailinglist, so that other's can follow the conversation. Please send your replies there too, but you'll need to subscribe first: http://lists.sourceforge.net/lists/listinfo/phpweather-devel > I am trying to setup phpweather to work with a mysql database. I am > having problems, when I use the database builder, it only creates > one table "pw_stations" but not "pw_metars" or "pw_tafs", as a > result phpweather is not caching the weather reports and so it is > very slow. Do you know how I can fix this? That's a bit strange --- if it creates one table, then I would expect to create them all... > Alternatively, can you supply me with the table structures as I > could not find this anywhere on your resource. The code to create the tables are found in db/pw_db_mysql.php. Having the SQL code in an extern file would actually be a good idea, I've just never thought of that before. function create_tables() { if (!$this->connect()) { return false; // Failure! } /* First we make a table for the METARs */ $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars']); $this->query('CREATE TABLE ' . $this->properties['db_metars'] . '( icao char(4) NOT NULL, time timestamp(14), metar varchar(255) NOT NULL, timestamp timestamp(14), PRIMARY KEY (icao))'); /* Then we make a table for the TAFs */ $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_tafs']); $this->query('CREATE TABLE ' . $this->properties['db_tafs'] . '( icao char(4) NOT NULL, time timestamp(14), taf varchar(255) NOT NULL, timestamp timestamp(14), PRIMARY KEY (icao))'); /* and so on... */ -- 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. |