Jump to content

Archived

This topic is now archived and is closed to further replies.

dalton6275

Perform calculations on MySQL table and store

Recommended Posts

Hey everyone,

Just wondering if any1 can help me with this MySQL/PHP programming problem i have.

I have a value in 2 fields in a MySQL table that i wish to perform calculations on in a PHP table.

The first is 'outagestart' and 'outagefinish' - and i simply want to perform a calculation to find the difference and store it in a variable.

The second is that i wish to perform another sum on this new variable by dividing it by the amounts of minutes in a month and then multiplying it by variable $percentofusers.

Simple enuff if i had 1 figure, but i am using the SQL statement:

"SELECT * FROM incidents WHERE AccentureResp = 'N'";

So i need the calculations to be performed on each individual row returned by this dynamic query and then store the total figure in a seperate variable.

Phew! Complicated enough for me to explain. Any1 have any ideas how i can sort this????

Thanks in advance for any help offered

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.