Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. conn = psycopg2.connect("dbname=fyp user=admin host=localhost password=admin")
  2. cursor = conn.cursor()
  3. 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))
  4. conn.commit()
  5. cursor.close()
  6. conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement