Sql/php Arithemetic Question

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Sql/php Arithemetic Question

SilverFox
I got a question, is there a way to subtract from something like the following:
$var = $row['SUM(Field)']-$var2;

Is there a way to subtract from a SUM result and have it distrubted? Or do I have to do some other complex stuff?

Thanks,

SF

Reply

Quatrux
I don't see any logic here, if you want to get the SUM of some-kind mysql field, then you need to get it into a variable or array and use it. tongue.gif

Reply

SilverFox
I got someone on my team to do it...using a simple array loop thing, I fixed it though wink.gif

Arrays (other than mysql ones) just totally leave me confused.

Reply

TavoxPeru
QUOTE(SilverFox @ Jun 15 2007, 05:42 PM) *
I got a question, is there a way to subtract from something like the following:
$var = $row['SUM(Field)']-$var2;

Is there a way to subtract from a SUM result and have it distrubted? Or do I have to do some other complex stuff?

Thanks,

SF

I don't really understand what you say, now i guess that you got the sum result from a db query and then you need to subtract the $var2 to it and show it, well i only say that yes you can do it as usual.

Best regards,

Reply

Quatrux
or another thing, that he wants the last result of the array, if so then you rather go and learn what is an array and just do some practical work, I am quite confused. smile.gif

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : Sqlphp Arithemetic


    Looking for sql, php, arithemetic, question






*SIMILAR VIDEOS*
Searching Video's for sql, php, arithemetic, question
advertisement




Sql/php Arithemetic Question