0
我在我的“用户”表中有money
列,我需要PHP来计算所有用户拥有的总金额。PHP获得所有行的价值
我知道这计数行,但我不知道怎么弄的钱总数在游戏中使用PHP
<?php
$r = $sql->query("SELECT * FROM `users` WHERE `health`='100' AND `level`='1'");
$user = mysql_fetch_object($r);
echo"There are:<br>";
echo mysql_num_rows($r);
echo" Users in the database<br>";
echo"Total there are:<br>";
echo number_format($user->money); //I want it to calculate how much money there are inn the game but i cant find a way to do this
echo" Money inn the game<br>";
?>
我知道我应该去的mysqli或PDO,但我会开始使用后来。