querySingle($src); if (count($res)==0){ $db->exec('CREATE TABLE coordinates (latitude TEXT, longitude TEXT, time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, added TIMESTAMP DEFAULT CURRENT_TIMESTAMP ) '); } $regex = '/^(|\-)([0-9]{2,3}\.[0-9]{0,8})$/'; if (preg_match($regex,$data->lat) && preg_match($regex,$data->lon) ) { $lat = $data->lat; $lon = $data->lon; } $ins = 'INSERT INTO coordinates (latitude,longitude) VALUES (\''.SQLite3::escapeString($lat).'\',\''.SQLite3::escapeString($lon).'\')'; $db->exec($ins); die(); } ?>
query('SELECT latitude,longitude,added FROM coordinates ORDER BY added DESC') or die($db->errorInfo()[2]);; while($obj = $result->fetchArray()){ $new_time = date("Y-m-d H:i:s", strtotime("+2 hours",strtotime($obj['added']))); echo ' '. ' ' . ' ' . ' '; } ?>
Latitude Longitude Time Added Details
' . $obj['latitude']. '' . $obj['longitude'] .'' . $new_time .'

Select Co-ordinates from the table to display address