Jump to content

Row Position in Database


Mutley

Recommended Posts

I'm wanting to find and echo the row position in a table when they are put into order and there is a certain where clause.

 

For example, I want to find what row position it is where ID = 7... ordered by `joindate`.

 

This might bring up 10 results, where the row with the above ID (7) is 5th in the results. How do I echo "5"?

 

I hope that makes sense.  :D Thanks, Nick.

Link to comment
https://forums.phpfreaks.com/topic/131936-row-position-in-database/
Share on other sites

It's for a Leaderboard. They have a number assigned to their position but this isn't stored in a database, it's simply by looping a count (e.g. $count = 0; $count++) when the results are displayed.

 

When a certain event happens I want this number to be stored in the database but the file the event in isn't linked to this Leaderboard, so I can't pass the $count over in anyway (like POST/GET or whatever). :)

 

Thanks,

Nick.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.