5, July 2009

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

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases
Topic: How to transfer some amount from one person's account to another's?
« previous next »
Pages: [1] Print

Author Topic: How to transfer some amount from one person's account to another's?  (Read 1486 times)
Where are my glasses?
*
Gender: Female
Posts: 20
166 credits
Members referred : 0



« on: Aug 20, 2008, 04:17:43 pm »

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.
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8565
44417 credits
Members referred : 3



« Reply #1 on: Aug 20, 2008, 07:27:30 pm »

Excuse me? I thought you can transfer money through paypal, not a database Smiley (otherwise I would be rich...)

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Community Supporter ?
Bill Gates is my home boy
*****
Gender: Male
Posts: 604
5566 credits
Members referred : 0


www.dg9.org


« Reply #2 on: Aug 21, 2008, 07:34:14 am »

Maybe she meant to transfer a value from one database to another database... Please clarify shilpamg...

http://www.dg9.org , Just Visit...
Partners:
http://www.resume-fix.com , Free Resumes

Last blog : Archos: Where are you?
Where are my glasses?
*
Gender: Female
Posts: 20
166 credits
Members referred : 0



« Reply #3 on: Aug 21, 2008, 01:14:26 pm »

I want to know the query to transfer some amount from one account to another.
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8565
44417 credits
Members referred : 3



« Reply #4 on: Aug 22, 2008, 04:36:12 pm »

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

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Where are my glasses?
*
Gender: Female
Posts: 20
166 credits
Members referred : 0



« Reply #5 on: Aug 25, 2008, 10:36:54 am »

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?
Bill Cosby is my Father
*
Posts: 4
24 credits
Members referred : 0


« Reply #6 on: Aug 25, 2008, 11:25:52 am »

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"
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7927
Tags : database Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases
Topic: How to transfer some amount from one person's account to another's?
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 05, 2009, 05:59:08 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 40.906
Total Topics: 8.089
Total Members: 5.828
Tutorials : 58
Resources : 929
Designs : 312
Latest Member: zizther

27 Guests, 3 Users online :

8 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2009 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.