Position of Record from database when filtered with a query

Position of Record from database when filtered with a query.

I have a database with say 3 records in it. the IDs are 2, 24, 65 - because of the other records deleted.

So when i query the database and place it in a DATA VIEW repeat.
I can then use $index to get the position of the record.

But the problem with that is if I filter the query… say on the tel to value 1
Then the $index idea wont work … because the data is now filtered…
I have added manually the position of the record in field… just to give you an idea…

So when i query… the page… test.html?tel=1


Then it would filter the 2 records … to display them on the page… eg id 2 and 65… position 1 and 3 in the database…

and then the same with test.html?tel=2

So the question is… how would i be able to get the position of the record from a query… is that even possible or am i going about the wrong way of this…?

Community Page
Last updated: