Jump to content

[Q]Dont know how to call it


Minase

Recommended Posts

first sorry for title dont know how to call this thread.

i have 2 tables users and alliances

USERS (CID,CAPTURE) - CID=Clan ID,CAPTURE=some points

ALLIANCES (ID,PID) PID = Player ID

 

i want to make something like a top of alliances ordered by capture.but i dont know how to structure it dang it  :o

 

first i used a query to make a sum of alliances points

 

$capture = mysql_query("SELECT SUM(Capture) AS CaptureSum FROM `" . DBPREFIX . "users` where CID=1");

but now how i can order the alliances by variable $capture?

$rank = mysql_query("SELECT * FROM `" . DBPREFIX . "alliances` ORDER BY ????? DESC");

 

can i structure it into a query? if yes how please?

and this is more like a php subject cause is not just a query.at what im thinking now i need to use 2 variables (1 to select sum from users,and another to order).but i dont have a clue how to do it

 

simple explain:

I want to make a simple alliance ranking who would order results by $capture

Link to comment
Share on other sites

thanks it worked but not how it was suposed i tryed editing it,but no luck...

http://img134.imageshack.us/img134/262/unbenanntau4.png

 

hope you understand better what i want to do in that picture if not let me explain again

 

first parse all aliances and sellect capture sum (from users) for every alliance.after that order them by capture.

hope you understand what i mean thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.