Jump to content

Calculate Stats


Rey

Recommended Posts

hi,

if following Problem i've a mysql database called ladder which got a table called Liga_stat.

this tabele got following rows

ID,Player1,Player2,scorep1,scorep2,date,time,winners_race_loser_race,replay

 

what i want to do is if i click on a player account it should open a dokument with teh whole stats of this player.

i got it that it shows up the nickanme , wins,loses and winratio, also which map this player played at most.

but what i don´t get is how to calculate the winratio for the player for each three races they are Protoss Terran and Zerg here an example

 

ID|player1|player2|scorep1|scorep2|date|time|winners_race|loser_race|map_name|replay

1 | test | rey|1 |0 | 2007-09-26 |09:17:44| t|p| Luna|lol.rep

2 | rey| test|1 |0 | 2007-09-26 |09:18:44| z|t| Luna|lol2.rep

3 | test| rey|1 |0 | 2007-09-26 |09:19:44| z|t| LT|lala.rep

 

So now if i click on teh account Rey teh Dokument opens and the Player detaisl have to show up

and also teh winratio with the race Protoss(p) Terran(t) and Zerg(z)

the stats would be for teh play rey withe the race Protoss (p) 0% because he had one game with the race Protoss and he lost it

with the race Terran(t) also 0% and with Zerg(z) 100%

how does the Calculation works

very easy

its the wins with the race + the lose's than the  (wins/sum)*100

 

ah... by the way on the normal php dokument twhere The palyers get listed and if i click on the account this dokument should open i made it like this <a href=\"playerdetails.php?nick=$nick\" target=\"_blank\">$nick</a>

 

so as you see  post the nick

i know that teh script begins so

 

<?php

$player = $_GET[$nick]

and now the rest i don´t know how to make it

 

 

I hope you can help me

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.