Welcome Guest, Not a member yet? Register   Sign In
A little help needed here
#1

[eluser]Samus[/eluser]
Okay so basically i'm working with codeigniter with some paypal integration.

Anyway to cut a long story short, when someone makes a payment and it is approved.

I have a method that is run which updates the 'amount paid' value in my table, then another method that is run that updates the 'percentage paid' value.

Now my problem is that now the the 'percentage paid' method runs before the 'amount paid' method, which means the 'percentage paid' value stays the same as it was before (because the amount paid value hasn't been updated yet) and the amount paid value updates after.

How would I get it so that the percentage value is updated after the paid value is updated?

I tried using sleep, but that didn't seem to work..

Code:
$this->endaproblem->update($xploded[1], $xploded[2], $update_paid);
     sleep(1);
     $this->endaproblem->update($xploded[1], $xploded[2], $update_percent);
Anyone have any ideas?
#2

[eluser]weboap[/eluser]
your code is vague, but cant you calculate the percentage before any interaction with the db then insert your final results ....
#3

[eluser]Samus[/eluser]
[quote author="weboap" date="1330823759"]your code is vague, but cant you calculate the percentage before any interaction with the db then insert your final results ....[/quote]

Actually now that I think about it, it makes more sense logically.

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB