Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- conn = psycopg2.connect("dbname=fyp user=admin host=localhost password=admin")
- cursor = conn.cursor()
- cursor.execute("INSERT INTO track_locationdata(location, speed, date_time, user_id) VALUES (ST_SetSRID(ST_MakePoint(%s, %s), 4326), %s, %s, 11);", (float(lat), float(long), float(speed), date_time))
- conn.commit()
- cursor.close()
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement