Weather Diary: Difference between revisions

62 bytes added ,  13:32, 28 July 2020
m
Line 54: Line 54:
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. It can also be accessed using PDO instructions in PHP Hypertext Preprocessor.
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. It can also be accessed using PDO instructions in PHP Hypertext Preprocessor.


Here is an example in a PHP 7.3 (there are changes for PHP 7.4) script of accessing any one day ($rowMetDayStamp in yyyy-mm-dd format):
Here is an example in a PHP 7.3 (there are changes for PHP 7.4) script (modification of script available in [[File:Snow diary.zip]]) of accessing any one day ($rowMetDayStamp in yyyy-mm-dd format):
<pre>$diary = 'sqlite:' . $snowDiary; // Parameter to identify a SQLite database puts a prefix in front of file path
<pre>$diary = 'sqlite:' . $snowDiary; // Parameter to identify a SQLite database puts a prefix in front of file path
$dbhandle = new PDO($diary);  // connect to db
$dbhandle = new PDO($diary);  // connect to db
5,838

edits