Hi,
Is it possible using mysql (and if it is how) to add up the contents of one field from a mysql table where the UID of the row = a variable.
I hope u can understand what im on about, thanks,
Chris
$q = "select sum(onefield) from ogrish where UID = " . $oneVariable;
assuming that UID is numeric
Thanks very much, how do i get the result into a variable now ie. $tot so that i can use it later in the script
Originally posted by Lars Berg $q = "select sum(onefield) from ogrish where UID = " . $oneVariable; assuming that UID is numeric [/B]
Originally posted by Lars Berg
assuming that UID is numeric [/B]
$q = "select sum(onefield) as [B]blah[/B] from ogrish where UID = " . $oneVariable; // various PHP commands and stuff (ie. SQL query exec) $tot = $row[ "blah" ];
Thanks very much for all your help, it works. Im very grateful for this.
Thanks Again, Chris