sir pannels
01-12-2003, 02:42 AM
hey
ok so what im trying to get at here is working out the total of something.
say for instances there is a table called USERS and there are sevral users, each user has a field called "number"
how would i work out what every users number is totalled..
so like user 1 number +user 2 number = user 3 and so forth.. i have this...
$conn=@mysql_connect("localhost", "", "")
or die("Could not connect");
$rs = @mysql_select_db("GAME", $conn)
or die("Could not select database");
$query="SELECT number FROM users";
#execute the query
$rs=mysql_query($query,$conn)
or die("Could not execute query");
but im lost as what to put when it does the query , as in the php code to work out the total number.
could i get a little help?
thanks :thumbsup:
ok so what im trying to get at here is working out the total of something.
say for instances there is a table called USERS and there are sevral users, each user has a field called "number"
how would i work out what every users number is totalled..
so like user 1 number +user 2 number = user 3 and so forth.. i have this...
$conn=@mysql_connect("localhost", "", "")
or die("Could not connect");
$rs = @mysql_select_db("GAME", $conn)
or die("Could not select database");
$query="SELECT number FROM users";
#execute the query
$rs=mysql_query($query,$conn)
or die("Could not execute query");
but im lost as what to put when it does the query , as in the php code to work out the total number.
could i get a little help?
thanks :thumbsup: