WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

Mathematical operation between two tables

Kariot

New member

0

0%

Status

Offline

Posts

50

Likes

0

Rep

0

Bits

260

5

Months of Service

0%
Friends, I need your help on a certain matter. To explain briefly: I need to perform a mathematical operation between two different columns of two different tables in my database and write the result to another column of a different table. The operation will involve multiple columns, but the result will be saved in a single column. Currently, I have successfully performed the mathematical operation between columns and displayed it on the screen. However, I am unable to save this result to another newly created table in the database. The solution may be simple, and I might be making a mistake in my code somewhere. Since I have been constantly dealing with this, my brain has stopped working, so I decided to write about it here. I would appreciate your help.

```php
$ah = $config_site["a_in_h"];
$bh = $config_site["b_in_h"];
$ch = $config_site["c_in_h"];
$dh = $config_site["d_in_h"];
$eh = $config_site["e_in_h"];
$fh = $config_site["f_in_h"];

$at = $user_data["a_t"];
$bt = $user_data["b_t"];
$ct = $user_data["c_t"];
$dt = $user_data["d_t"];
$et = $user_data["e_t"];
$ft = $user_data["f_t"];

$total = (($ah * $at) + ($bh * $bt) + ($ch * $ct) + ($dh * $dt) + ($eh * $et) + ($fh * $ft));
echo $total;
```
 

249

6,622

6,642

Top