Go back
Move counter???

Move counter???

General

Vote Up
Vote Down

Russ can probaly easily tell you guys the total number of moves.


$sql = "SELECT <moves_field> FROM <users_table>"
$resultSet = mysql_query($sql)

while ($usrMoves = mysql_fetch_array($resultSet)) {
$total += $usrMoves['<moves_field>']
}

echo $total


😛

1 edit
Vote Up
Vote Down

Originally posted by Crowley
Russ can probaly easily tell you guys the total number of moves.


$sql = "SELECT <moves_field> FROM <users_table>"
$resultSet = mysql_query($sql)

while ($usrMoves = mysql_fetch_array($resultSet)) {
$total += $usrMoves['<moves_field>']
}

echo $total


😛
Well, I don't like to pick holes in people's code* but

$sql = 'SELECT SUM( &lt;moves_field&gt; ) FROM &lt;users_table&gt;' is what you want 😉

Anyway, the total is..........

27,984,090

-Russ

*(that is a lie, I LOVE doing it....never let me do a code review - I turn into Hitler)

Vote Up
Vote Down

So, less than some of you predicted - but still staggering to me. Now all you 100k guys can see what a percentage of all that you are responsible for!!! (Quite a lot!)

BTW : The above figure excludes the single player game moves that we used to support. These are all human vs human.

-Russ

1 edit
Vote Up
Vote Down

Originally posted by Russ
Well, I don't like to pick holes in people's code[b]* but

$sql = 'SELECT SUM( <moves_field> ) FROM <users_table>' is what you want 😉

Anyway, the total is..........

27,984,090

-Russ

*(that is a lie, I LOVE doing it....never let me do a code review - I turn into Hitler)[/b]
Bugger, that IS more efficient. Forgot about the nice SQL SUM function...

That's why you get the big bucks 😉

Vote Up
Vote Down

Originally posted by Cheshire Cat
738150

That time 40 is:

29,526,000
So this was actually pretty accurate...