Go back
Move counter???

Move counter???

General

C
Not Aleister

Control room

Joined
17 Apr 02
Moves
91813
Clock
20 Oct 04
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


😛

Russ
RHP Code Monkey

RHP HQ

Joined
21 Feb 01
Moves
2450
Clock
20 Oct 04
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)

Russ
RHP Code Monkey

RHP HQ

Joined
21 Feb 01
Moves
2450
Clock
20 Oct 04
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

C
Not Aleister

Control room

Joined
17 Apr 02
Moves
91813
Clock
20 Oct 04
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 😉

C
Not Aleister

Control room

Joined
17 Apr 02
Moves
91813
Clock
20 Oct 04
Vote Up
Vote Down

Originally posted by Cheshire Cat
738150

That time 40 is:

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

Cookies help us deliver our Services. By using our Services or clicking I agree, you agree to our use of cookies. Learn More.