itzumar
Posts: 88
|
Posted: 01/28/2013, 2:10 PM |
|
hi!
i try to make loan application in code chrage studio using mysql and php. the probelm is that I want to use previous record calculated value in new record of the same table. but howw?
any body help mee????/
for example: table have three fileds 1)total 2)installment 3)balance
total installment balance
10 2 8 (10-2)
Now i want 8 in total as it come from record 1
8 2 6
and so on
plz help me
_________________
Umar |
|
|
itzumar
Posts: 88
|
Posted: 01/29/2013, 3:50 AM |
|
dear!
i did whiuch you suugest me. but it give maximum value in all row.
i want that
balance= total-installment
than next time balance value become total value
_________________
Umar |
|
|
saseow
Posts: 744
|
Posted: 01/29/2013, 4:58 AM |
|
Use something like this:
select MIN(balance) from tablename. This would be your 'select' part of the insert statement.
Perhaps you should look at the MySQL syntax for this kind of stuff:
http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
|
|
|