View Single Post
Old 09-03-2011, 01:49 PM  
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
Can't find my own code for where I did something like this but I know it works.. Whether you can do it or not depends on your version of mysql.. You need to add a "rank" field to your videos table as well.. Then it's something like this

Code:
SET @r=0;
UPDATE videos SET rank= @r:= (@r+1) ORDER BY viewcount ASC
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote