Reputation: 255
I have a script that pulls values from a MySQL database and puts into into a variable. Each time it iterates, it pulls a new value. I want to add these values together. Here's what I have:
while ($row = mysql_fetch_array( $result )) {
$getvalue = mysql_query("SELECT value FROM pointvalues WHERE code = '$row[code]'")or die(mysql_error());
$rowcode1 = mysql_fetch_array($getvalue);
$finalValue = $rowcode1["value"];
}
I want to keep adding $finalValue to itself.
Upvotes: 0
Views: 53