Forum Moderators: open

Message Too Old, No Replies

Update sql table dynamicaly

Need to update sql with weather data

         

cheaperholidays

3:47 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



Hello

I hope this is the correct forum to post this, but here goes

We have an sql databse and need to update this with fresh data every day is there an easy way to do this.

Have been searching all day hence "brain fried"

At the moment all this is done on a manual basis.

Thanks

txbakers

5:17 pm on Oct 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, not sure what it is you are trying to do.

You can automate an update query if you want to.

cheaperholidays

5:24 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



Sorry for being a bit DUH

Idealy we would like to run a php include file, from an sql table and return the results however having problems getting this to work.

Some page we have taken out of sql for this very reason but having several hundred is going to be painful.

For example http#//www.domain.com/weather-forecast-1.htm is sql data with the weather uploaded manualy.

Thiis an ex of an htm page http#//www.domain.com/tenerife-weather-forecast.htm which updates on auto.

This is what we get bck after upload.

UPDATE `destinations` SET `xml_feed` = ' Maldives weather on Saturday: heavy showers. Max Temp: 30°C (86°F), Min Temp: 24°C (75°F), Wind Direction: SW, Wind Speed: 15mph, Visibility: very good, Pressure: 1012mb, Humidity: 85%, Sunrise: 05:50MVT, Sunset: 17:49MVT' WHERE `id` = 7 LIMIT 1;

How can we update this automaticaly or can we run an include file from within the table data

Thanks
Pete

[edited by: txbakers at 6:43 pm (utc) on Oct. 28, 2006]
[edit reason] no personal URLs [/edit]

chronic

5:30 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



You can use the eval function in php to take a string and execute it as php.

I'm not sure your question is very clear, however.

cheaperholidays

7:27 pm on Oct 28, 2006 (gmt 0)

10+ Year Member



How do we us an eval function?

how can we run say weather-inc.php within the sql table

Pete

wheelie34

2:47 pm on Oct 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pete

I do exactly what you want to do, I take it that you already display the current days weather data on a page?

I display it all on a page with a db insert statement that checks the time (between 12:00 and 14:00) checks if the db already has todays weather, if not, it inserts it to the db ON PAGE LOAD next time page is loaded it checks and sees theres data already so does nothing.

This all will only happen IF someone visits the page between those hours.

HTH