Hey guys i want a sum of an mysql query and an php variable. Is there a function to do this? Here is what i tried:
$result3 = mysql_query($sql3);
while ($resultarray3 = mysql_fetch_array($result3)){
$Ergebnis = $Menge + $resultarray['Bestand'];
echo $Ergebnis;
}
Can anyone help me on this?
Edit: I want a sum of an php variable and an mysql query not of two sql tables!!!!
SUM()function in MySQL that may server this purpose more efficiently, depending on how/what you're using.$Ergebnis .= $Menge + $resultarray['Bestand'];because when i use my solution$Ergebnisis the same as$menge