I have a table like this:
stepID | UserID| Date | Lat | Lng
1 |1 | 2019-10-11 | -7.2905838 | 112.5655568
2 |1 | 2019-10-11 | -7.2349607 | 112.6106177
3 |1 | 2019-10-11 | -7.2345435 | 112.6112432
4 |1 | 2019-10-12 | -7.2529265 | 112.6542999
I need to calculate distance that user has been visited on the same day (for example 2019-10-11). So waht will be show on PHP page is (the KM amount below is an example) :
From step 1 to 2: 2 KM
From step 2 to 3: 3 KM
From step 3 to 4: 3 KM
TOTAL FOR TODAY: 8 KM
I've googling and also search in this stackoverflow's history but didn't found like what I face today. Need your suggestion how to query this. Thank you before, GBU always.