diff --git a/server/python_server.py b/server/python_server.py index 81a9831..5e45271 100644 --- a/server/python_server.py +++ b/server/python_server.py @@ -59,7 +59,7 @@ def getGpsDistance(): cur = conn.cursor() try: - res = cur.execute(f'SELECT lat, long, gpsDateTime, insertDateTime FROM location_data WHERE sender_id = {req_id} ORDER BY insertDateTime DESC;') + res = cur.execute(f'SELECT lat, long, gpsDateTime, insertDateTime FROM location_data WHERE sender_id = {req_id} ORDER BY ROWID DESC LIMIT 1;') row = res.fetchone() if row: