View Single Post
Old 09-03-2011, 09:59 AM  
camperjohn64
Confirmed User
 
Industry Role:
Join Date: Feb 2005
Location: Los Angeles
Posts: 1,531
Here is the result mysql statement I got that sets rank:

UPDATE bd_user i, (SELECT @rownum:=@rownum+1 'bd_rank', u.bd_id FROM bd_user u, (SELECT @rownum:=0) r ORDER BY bd_likes DESC) q SET i.bd_rank=q.bd_rank WHERE i.bd_id=q.bd_id;

I like what you wrote and will re-read it to make sure I understand it.
__________________
www.gimmiegirlproductions.com
camperjohn64 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote