Online list ... and a Stats Page for Players

Forum
Last Post
Threads / Messages

Milly Money

Pet-Sim.Online
Staff member
Dev Staff
Joined
Jan 27, 2010
Messages
538
Points
18
Mysidian Dollar
28,331
How would I adjust the Online list to show Players in order of who has the most pets?

Also, I'd like to make a stats page for Players ... something simple that just shows their number of pets, in that order, their name, and that sort of thing :)
 
Umm, let me think... I don't know how it is with your version, but with mine, I think you'd have to write a code on the online page or something like that that for each user displayed, the code will go to the owned_adoptables table and return the count of all adoptable rows that have an owner that matches the user's name. Then, I remember reading a PHP book that tells you how to count rows and order by value, but I have no clue if that'll work with mysidia.
Another much easier way to do this if your site has no pets, is maybe to add a pet count column in the users table and set it to 0. Then, each time a user adopts a pet, add the number of pets adopted to the value. Then do the order thing.

Did that make any sense?
 
I do have pets on there, but what code would I use to call it up for the total :)

Sorry I have tried a few times here and failed haha. Thanks for your help !
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top