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


<?php
if($_SESSION['power']=='No' && $_SESSION['display']=='No' && $_SESSION['liquid']=='Yes' && $_SESSION['buttons']=='Yes' && $_SESSION['enclosure']=='Yes')
{
$quotedprice = $result["price3d"];
}
?>

 

Edited by dardime
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.