sad69
03-25-2004, 12:27 AM
Hey all,
I've got a question in regard to MySQL. Consider this example:
3 columns: net_amt, increase, gross_amt.
Can you make it so that if you insert a new row and provide net_amt and increase (where increase is a percentage), it will automatically calculate the gross?
so let:
net_amt = 5000
increase = 38
then:
gross = 6900
[5000 * 1.38 = 6900]
I'm not using PHP to insert these values, but I will be using phpMyAdmin to insert rows into this table and update this table. I'm just wondering if MySQL gave you that ability.
I suppose I could create a page that would do the above in PHP, but if MySQL will do it for me, that would save me some time!
So if you know that it can be done (or if it can't be done..), please let me know!
Thanks,
Sadiq.
I've got a question in regard to MySQL. Consider this example:
3 columns: net_amt, increase, gross_amt.
Can you make it so that if you insert a new row and provide net_amt and increase (where increase is a percentage), it will automatically calculate the gross?
so let:
net_amt = 5000
increase = 38
then:
gross = 6900
[5000 * 1.38 = 6900]
I'm not using PHP to insert these values, but I will be using phpMyAdmin to insert rows into this table and update this table. I'm just wondering if MySQL gave you that ability.
I suppose I could create a page that would do the above in PHP, but if MySQL will do it for me, that would save me some time!
So if you know that it can be done (or if it can't be done..), please let me know!
Thanks,
Sadiq.