General
20 Oct 04
Originally posted by CrowleyWell, I don't like to pick holes in people's code* but
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
😛
$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)
Originally posted by RussBugger, that IS more efficient. Forgot about the nice SQL SUM function...
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]
That's why you get the big bucks 😉