Jump to content


Photo

Perform calculations on MySQL table and store


  • Please log in to reply
No replies to this topic

#1 dalton6275

dalton6275
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 05 April 2006 - 09:04 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users