![]() |
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 |
Where are you wanting this to show up?
|
I just need to run it in the ACP to find the members with X number of Friends.
|
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. |
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.
|
not sure whether this would work
select friendcount,username,userid from vb_user; |
That did work, any way to sort the results from most to least Friends? Right now randomly displayed across 64 pages.
|
Use this:
Code:
SELECT username, friendcount FROM vb_user WHERE friendcount >= 100 |
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. |
Quote:
|
All times are GMT. The time now is 07:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|