mdmartiny Posted March 12, 2017 Share Posted March 12, 2017 In a section of a script that I am writing I output the number of records for the person logged into the system. so it looks something like this. 13 of 5 (13 being the id and 5 being the total number of records). What I want to do is get something like this 1 of 5 It doesn't show the record id but the number of the record for that person. Would this be a pagination thing or is there another way of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/303440-record-numbers-from-a-database/ Share on other sites More sharing options...
Barand Posted March 12, 2017 Share Posted March 12, 2017 Use a counter and increment it Quote Link to comment https://forums.phpfreaks.com/topic/303440-record-numbers-from-a-database/#findComment-1544144 Share on other sites More sharing options...
mdmartiny Posted March 12, 2017 Author Share Posted March 12, 2017 How would I use a counter to do this? Quote Link to comment https://forums.phpfreaks.com/topic/303440-record-numbers-from-a-database/#findComment-1544148 Share on other sites More sharing options...
Barand Posted March 12, 2017 Share Posted March 12, 2017 $num_recs = 5; for ($count=1; $count<=$num_recs; $count++) { echo "$count of $num_recs<br>"; } But I could give you a more relevant example if you could get around to posting the code you have at present. Quote Link to comment https://forums.phpfreaks.com/topic/303440-record-numbers-from-a-database/#findComment-1544149 Share on other sites More sharing options...
mdmartiny Posted March 13, 2017 Author Share Posted March 13, 2017 I see what you are saying now by counter. I can figure out the rest on my own. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/303440-record-numbers-from-a-database/#findComment-1544157 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.