The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need a query to find the number of Friends members have
Hello all,
I am trying to find a query I can run that will output the number of Friends/Buddies members on my site have. Can someone please help with this? Thanks, Keith |
#2
|
||||
|
||||
Where are you wanting this to show up?
|
#3
|
|||
|
|||
I just need to run it in the ACP to find the members with X number of Friends.
|
#4
|
|||
|
|||
There's a field called "friendcount' in the user table, so maybe
Code:
SELECT friendcount FROM vb_user WHERE userid=100 although I haven't tried it. Of course "vb_" should be whatever your table prefix actually is, and "100" should be the id of the user you're insterested in. |
#5
|
|||
|
|||
Thanks kh99, that did tell me the number of Friends for the use entered, but what I'm looking for is a query that will output the usernames of members that X number of Friends or more. Sorry, I should have been more clear on my needs.
|
#6
|
|||
|
|||
not sure whether this would work
select friendcount,username,userid from vb_user; |
#7
|
|||
|
|||
That did work, any way to sort the results from most to least Friends? Right now randomly displayed across 64 pages.
|
#8
|
|||
|
|||
Use this:
Code:
SELECT username, friendcount FROM vb_user WHERE friendcount >= 100 |
#9
|
|||
|
|||
The query sulasno posted worked, I added
Code:
ORDER BY friendcount DESC Thanks for everyone's help. --------------- Added [DATE]1284190422[/DATE] at [TIME]1284190422[/TIME] --------------- vB Style, yours worked as well allowing me to set the cutoff number for Friends. |
#10
|
|||
|
|||
I should have realized that you'd want to output more than the number, I just wasn't thinking.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|