exec(' CREATE TABLE IF NOT EXISTS history( tst INTEGER PRIMARY KEY, lat FLOAT, lon FLOAT, acc INTEGER ) '); $stm = $db->prepare(' INSERT INTO history( tst, lat, lon, acc ) VALUES ( :tst, :lat, :lon, :acc ) '); $stm->bindValue(':tst', $data['tst'], SQLITE3_INTEGER); $stm->bindValue(':lat', $data['lat'], SQLITE3_FLOAT); $stm->bindValue(':lon', $data['lon'], SQLITE3_FLOAT); $stm->bindValue(':acc', $data['acc'], SQLITE3_INTEGER); $res = $stm->execute(); } $response = array(); # optionally add objects to return to the app (e.g. # friends or cards) print json_encode($response); ?>