Jump to content

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.