Jump to content

Recommended Posts

Hi friends,

  I am creating a  site where  users can add credit  to their account via Liberty Reserve, and after  that their account  will  automatically  be updated with  the amount they added so that they can use it to purchase products.. And  after any purchase,  the amount will be subtracted from their account.. I cant  really  find a  php code  to do that... i have done  a  search on here but still cant  find anything close to it.. Can someone kindly help? Thank you

Link to comment
https://forums.phpfreaks.com/topic/236896-updating-account-balance/
Share on other sites

That's the way PHP was for me when I first starting dealing with it.  I finally went and bought a good book on it and started from the beginning and gradually worked my way through it.  It actually had a shopping cart in the back of it.  By the time I got to the shopping cart, I knew my way around in the code.

do you want to create this yourself or use someone elses script?

 

I know about that but it doesnt update the account of the  user that makes the  payment.. Thank you anyway

 

The hard part is actually making the payments updating the account's balance should be easy. Something along the lines of:

 

$sql = "UPDATE account SET balance += $points WHERE account_id = $account_id";
if (mysql_query($sql)) {
  // succeeded
}

do you want to create this yourself or use someone elses script?

 

I know about that but it doesnt update the account of the  user that makes the  payment.. Thank you anyway

 

The hard part is actually making the payments updating the account's balance should be easy. Something along the lines of:

 

$sql = "UPDATE account SET balance += $points WHERE account_id = $account_id";
if (mysql_query($sql)) {
  // succeeded
}

 

Thank you Ignace.. I think this should work then, because the payment is via LR and that is easy.. so i will try and let you know.. thanks  again.

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.