i see that people speak a lot about it here and i see great weather sites, using it.
but where can i find a “how to”?
to create a database seems easy for me, but how people create nice pages, where they use this database, how they been able to make them search able or even create nice graphs with it?
i search this forum here, but find no topic, where things are explaind.
if someone can point me to a direction, will be nice.
best regards
vossen
good Q
maybe we could start a thread for people to share the MYSQL database scripts (php, perl, etc), so not everyone has to reinvent the wheel
just some simple graphing scripts for starters (I would love to have a couple for my sight)
1.6 of wdmysql out now…fix for the 10 minute logging option, and it now checks for a key violation error, and restarts itelf (that has occasionaly being happening to me, despite the fact I have lots of check in place already for not duplicating data (but it still happens)
http://www.weather-display.com/windy/gb/indexmysql.php
check out that simple php script, which i borrowed from a site…
Brian, this will be nice, so that we all can learn it and perhaps to add this later to you help file.
i hope people will share there knowlage.
regards
vossen
actualy, it hides the source code when you view the source in IE!
Next I will source out a graphing script
I will post that here:
[code:1]
WD TEST PAGE
<?php // Start PHP code here // Enter site specific info here *** $dbf="windy"; // Database name *** $table="wx_data"; // Table name *** $order="date"; // Sort Order $nlimit=1440; // Number of Records limit display $myserver="81.29.70.124";// Server with MySQL *** $myuser="windy"; // MySQL access user *** $mypassword="******"; // MySQL user password *** // Connect to the database server $linkID = @mysql_connect($myserver,$myuser,$mypassword); if (!$linkID) { echo("Unable to connect to the " .$myserver. " database server at this time.
" ); die(); } // Select the database if (! @mysql_select_db($dbf,$linkID) ) { echo( "Unable to open the " .$dbf . " database at this time.
" ); die(); } // Request the Field data from $dbf // Manually selected Fields to display $query="SELECT time,date,average_windspeed,wind_direction,gust_windspeed,temperature,outdoor_humidity,". "barometer,day FROM $table"." ORDER BY $order DESC"; // Run the SQL query $result =mysql_query($query,$linkID); if (!$result) { echo("Error performing query: " .$query. " ".mysql_error() . "
"); die(); } // Number of records returned $nrows =mysql_num_rows($result); // Print the Table Header print ""; echo("From Table: $table in DataBase: $dbf, "); echo("the lastest $nlimit records of total: ".$nrows." "); print "
"; // Manual Table Layout print ""; print ""; // Print the text of each field as table cell, stop at limit. $nrec=1; for ($nrec=1;$nrows;$nrec++) { $row = mysql_fetch_row($result); print ""; foreach ($row as $field) { print ""; } print ""; if ($nrec>=$nlimit) break; } print "Time | Date | windspeed | direction | gust speed | temperature | humdity | barometer | Day |
---|---|---|---|---|---|---|---|---|
$field   |
MySQL+PHP
"; ?>[/code:1]
some good places to start (you will need to login and register to get the full benifit)