• PHP Help General Help
  • [RESOLVED] Updating MySQL table value when calculated sum is 1000 or over, doesn't complete

Hi,
This is so grazy fault, that i'm totally stuck with it. Any change to calculation order or to calculation function doesn't help.
If the calculated value is below 1000, everything is working just fine, no problems.

Here are the calculations:
if (isset($POST['refresh'])) {
$OrderedAmt=($
POST['OrderedAmt']);
$RetailPrice=($POST['RetailPrice']);
$TaxRate=($
POST['TaxRate']);
$Rate=($TaxRate/"100"+"1");
$Tax=$OrderedAmt($RetailPrice-($RetailPrice/$Rate));
$Total=$OrderedAmt
$RetailPrice;
$TaxFree=$Total-$Tax;
$Tax=number_format("$Tax", 2, ".", "");
$TaxFree=number_format("$TaxFree", 2, ".", "");
$Total=number_format("$Total", 2, ".", "");
}
if (isset($_POST['update']));

I have 2 submit-buttons. First make the calculation above, and second submits new values to table:
$updated = mysqli_query($db,"UPDATE offer SET ProductName='$ProductName',...and so on

Cannot find any other similar issues from any forum.

Have anyone clue, what could be the issue, when this happens?

    Check to see what the column type is for the value you are trying to save.
    I'm guessing it's a float or decimal without enough characters allowed.

      Hi,
      It's a decimal (5,2), so it should be allow over 1000.
      This environment is in cloud-portal,location uk. So there is different timezone and location that i have here in finland.
      I do not have access to php.ini also, if the fault comes there.

        Oh yes, that it was. Thanks for fixing my logic. I taugth that there is 5-digits in left and 2 in right. :-)

          masimies;11053279 wrote:

          Oh yes, that it was. Thanks for fixing my logic. I taugth that there is 5-digits in left and 2 in right. :-)

          Been there, done that.. got the T-shirt. Glad I could help 🙂

            Mwah - I want that up-vote.. oh wait, wrong forum :evilgrin:

              Write a Reply...