chrison600 Posted June 5, 2003 Share Posted June 5, 2003 Hi all, I would like to perform a simple multiplication operation against a field stored in a MySQL database. I need the results returned to a particular field in a table other than that which contains the multiplied field... That\'s as clear as mud... A function that represents what I would like to do would be something like: .02x = y Where x is a PRICE field and y is a FEE field. In other words, I want to charge a FEE that is 2% of the PRICE. The PRICE is stored in the \'PRICE\' field of the \'g_class\' table. The FEE is stored in the \'CHARGE\' field of the \'g_c_price_inc\' table. The \'CHARGE\' field is a DOUBLE (16,2) type. I can manipulate the \'CHARGE\' field directly, but I would like to stay away from changing the field type. I\'m not sure #1) if I can enter a formula into the \'CHARGE\' field without changing the field attributes, and #2) what the heck the formula should look like. Can anyone help? Thanks, Chris Quote Link to comment https://forums.phpfreaks.com/topic/550-calculcation-based-on-mysql-field-newbie/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.