Sublime directory Surf the web anonymous Pagerank Monitor


How to transfer some amount from one person's account to another's?

shilpamg
Wed 20 August 2008, 03:17 pm GMT +0200
I want to transfer some amount of money from one person's account to another person's account through database.
please explain me the procedure.

Nikolas
Wed 20 August 2008, 06:27 pm GMT +0200
Excuse me? I thought you can transfer money through paypal, not a database :) (otherwise I would be rich...)

designer
Thu 21 August 2008, 06:34 am GMT +0200
Maybe she meant to transfer a value from one database to another database... Please clarify shilpamg...

shilpamg
Thu 21 August 2008, 12:14 pm GMT +0200
I want to know the query to transfer some amount from one account to another.

Nikolas
Fri 22 August 2008, 03:36 pm GMT +0200
You need 2 queries.

1) UPDATE table SET money = money - 1 WHERE user = 1 LIMIT 1
2) UPDATE table SET money = money + 1 WHRE user = 2 LIMIT 2

Of course this wont check if the first user have the money, so you will have to check that too with a query in the beginning

shilpamg
Mon 25 August 2008, 09:36 am GMT +0200
You need 2 queries.

1) UPDATE table SET money = money - 1 WHERE user = 1 LIMIT 1
2) UPDATE table SET money = money + 1 WHRE user = 2 LIMIT 2

Of course this wont check if the first user have the money, so you will have to check that too with a query in the beginning

What is 1 limit 1 and 2 limit 2?

uploadingcom
Mon 25 August 2008, 10:25 am GMT +0200
More correct solution will be:

- check balance and transfer possibility
- transfer from account 1 to "wallet", decrease "balance 1"
- check transfer (approve or reject)
- if "approve": transfer from "wallet" to account 2, increase "balance 2", decrease "wallet"
- if "reject": transfer from "wallet" to account 1, increase "balance 1", decrease "wallet"

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional