Diary.db: Difference between revisions

261 bytes added ,  13:55, 4 April 2021
m
Line 22: Line 22:
*Entry (a text field for storing comments)
*Entry (a text field for storing comments)


== Accessing MX diary outside MX ==
= Accessing MX diary outside MX =


The weather diary is stored in [[diary.db|a sqLite database]] and that can be easily accessed by any ODBC software e.g. Libre Office Base. It can also be accessed using PDO instructions in PHP Hypertext Preprocessor.
The weather diary is stored in a sqLite database and that can be easily accessed by any ODBC software (e.g. Libre Office Base) and many other well known database software. It can also be accessed using PDO instructions in PHP Hypertext Preprocessor.


Here is an example in a PHP 7.3 (please note, this script will not work without changes for PHP 7.4, and PHP 8.x) script (modification of script available in [[File:Snow diary.zip]]) of accessing any one day ($rowMetDayStamp in yyyy-mm-dd format):
Here is an example in a PHP 7.3 (please note, this script will not work without changes for PHP 7.4, and PHP 8.x) script (modification of script available in [[File:Snow diary.zip]]) of accessing any one day ($rowMetDayStamp in yyyy-mm-dd format):
Line 47: Line 47:
foreach($row as $key => $value )
foreach($row as $key => $value )
{
{
if($key == 'Timestamp')
[[Setting_up_Raspberry_Pi#Editing_the_Weather_Diary]] if($key == 'Timestamp')
{
{
$keyDate = substr($value, 0, 10);
$keyDate = substr($value, 0, 10);
Line 67: Line 67:
}
}
</pre>
</pre>
==Editing==
Please see [[Setting_up_Raspberry_Pi#Editing_the_Weather_Diary]], although that applies to Linux devices a similar approach can be taken using Microsoft Windows.




5,838

edits