<?php
$dbname='base1';
$mytable ="tablename";
if(!class_exists('SQLite3'))
die("SQLite 3 NOT supported.");
$base=new SQLite3($dbname, 0666);
/*
$query = "CREATE TABLE $mytable(
id integer primary key autoincrement
, timestamp datetime default current_timestamp
, sensor_id integer not null
, value real
)";
*/
$query = "insert into $mytable( sensor_id , value )
values( 1, 259 )";
$results = $base->exec($query);
$result = $base->query("SELECT * FROM $mytable") or die('Query failed');
while ($row = $result->fetchArray())
{
echo "{$row['timestamp']} : {$row['value']} <br/>";
}
//clase base à faire
?>