Question : How can I multiply table 1 column by table 2 column then add all the results?

I'm stuck on this problem. I'm trying to pull Column A from Table 1 and Multiply it by Column B from Table 2, that part is working so I get Result 1, Result 2, Result 3, etc.  I echoed this out and it all looks great.  

Now I need something like:  
$grand_total = (Result 1 + Result 2 + Result 3 + etc.)

I can't figure out how to add all the results, I have played around with a "foreach" statement with no luck and I also tried performing the math inside the sql queries, but I couldn't get that to work either.  It seems like this would be possible and that I am missing some simple little trick, but I can't seem to find it.  

Any help is appreciated, thanks.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
$sum_polys_query = ("SELECT type_polys, polys FROM 1master_scan_sheet WHERE property_name = '".$res['PROPERTY_NAME']."' AND active='Yes' GROUP BY type_polys");
							$result = mysql_query($sum_polys_query) or die(mysql_error());
							while ($row9 = mysql_fetch_array($result)){
						  	
$poly_cost_query = mysql_query("SELECT * FROM 1plot_info WHERE plot_type = '".$row9['type_polys']."'");
							while ($row10 = mysql_fetch_array($poly_cost_query)){
$mult_result = ($row10['plot_price']*$row9['polys']);

echo $row10['plot_price'] . " x " . $row9['polys'] . " = " . ($row10['plot_price']*$row9['polys'])."<br>" ;
}
}

Answer : How can I multiply table 1 column by table 2 column then add all the results?

Did you add the root by using command smbuser and setting password for root with command smbpasswd?

A Linux user should have the separate smbpasswd to access the smbshare from the different system like Windows

Sudeep
Random Solutions  
 
programming4us programming4us