Skip to content
Advertisement

get the index number of data gotten from mysql database

I am trying to get all user data from my mysql table and i want to check the index number of where a particular data is for example if there are 10 users in the database and after getting the data from it i want to check if any of the user ID matches the one i have then get the index number where he is placed at. if his data is in number 4 or 8

JavaScript

Advertisement

Answer

Increment a counter variable in the loop.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement