Example column in sql:
id|viewed
1|1000
35|500
47|1200
79|700
84|300
I use "SELECT * FROM table ORDER BY viewed desc", the result I get:
47|1200
1|1000
79|700
35|500
84|300
But I want to add "number order" by Top id ( like ranking ) in PHP, example text:
- ID 47 is 1
- ID 1 is 2
- ID 79 is 3
- ID 35 is 4
- ID 84 is 5
So what I need to add these top with PHP guys, I think will use $i++ to count number or something like this in php ?