elianero elianero - 1 year ago 70
MySQL Question

Simple Math with tables PHP

I have a table called

that contains only numbers. And i want to increse these numbers by a certain amount but it doesn't work.

Here's my code:


$seuil_haut= array_product(($row['seuil_pil']*$roof) + $row['seuil_pil']);


$seuil_haut= array(($row['seuil_pil']*$roof) + $row['seuil_pil']);


$seuil_haut= ($row['seuil_pil']*$roof) + $row['seuil_pil'];


foreach ($row['seuil_pil'] as $seuil_haut[])
$seuil_haut[] = ($roof * $row['seuil_pil'] + $row['seuil_pil'] );

Answer Source

Use a foreach:

$roof = 0.12;

foreach($row['seuil_pil'] as $entry) {
    $entry *= (1 + $roof);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download