Jump to content

subtracting a value from a row in mysql using radio button


dardime

Recommended Posts

Hi

 

I have tried using an if statement condition:

<?php if($_SESSION['power']=='No' && $_SESSION['display']=='No' && $_SESSION['liquid']=='Yes' && $_SESSION['buttons']=='Yes' && $_SESSION['enclosure']=='Yes') {?>
             <div class="pricefont"><b>$<?php echo $result["price3d"]; ?></b></div> Quoted Price<br><br>
             <?php } ?>

And i have these values stored in price, price2d, price3d, price4d, price5d amd whatever the condition met it outputs the value in row. It will show the value but i don't know how to insert this value to database as its only a result.

If it can be then  it will solve my problem. Please find screenshot

attachedimg.PNG

Link to comment
Share on other sites

So how does the calculation work exactly? You start with a base price, and each defect reduces it by 5.00? Then simply count the “No” selections.

price = base_price − defect_count × 5.00  

Note that with some of your example data, the result will be 0.00 if all selections are “No”.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.