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,但我會開始使用後來。