5, December 2008

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 558 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: 8272
42619 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 Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Community Supporter ?
I am a fanatic. So?
*****
Gender: Male
Posts: 589
5476 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 Visit through proxy , Just Visit...
Partners:
http://www.resume-fix.com Visit through proxy , 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: 8272
42619 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 Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Dec 05, 2008, 09:58:47 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: 37.995
Total Topics: 7.685
Total Members: 4.470
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: srinivasarao

25 Guests, 3 Users online :

10 users online today:



Readers

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