0
[Solved]How do I write this MYSQL query in php?
I was designing a banking system project and here I want to perform a transaction between two person, Let's say A and B, A sends money than money get reduced from sender's account and increases in receiver's account. I had performed but it was not working money get added but not updating. Sorry for my english. I am learning.
4 Respuestas
0
No one can help until you at least share your database table structure for better view of the problem.
0
We cannot easily guess what is wrong without seeing the source code. Either post it here or post a link to it.
One problem is clear. In bank transfers you need to perform the UPDATE statements together. If one fails then you must ROLLBACK all changes to ensure money is not lost nor wrongly added. Wrap the UPDATE statements inside a SQL transaction by using START TRANSACTION, and COMMIT or ROLLBACK statements. You can learn from the example here: http://www.phpknowhow.com/mysql/transactions/
0
Thanks Brian for your refrence
0
Thanks Ipang I already got how to perform transaction