Just wondering what would be the best way of adding all the values in a column together where the pid=$pid in a column.
Here's some sample code of what I'm using:
$query = mysql_query("SELECT pid, reputation FROM reputation WHERE pid=\"{$post['pid']}\"");
while($rep = mysql_fetch_assoc($query))
{
echo $rep['reputation'];
}
That works fine, but when more than one row exists where the pid=X I need the reputation column on those rows to add together and output the result.