Prank Posted April 14, 2006 Share Posted April 14, 2006 Hi Guys,I am a bit unsure of how to do this, I'd appreciate any help.What I am trying to do is add up a total number as reported by variables, but the problem is that its the same variable..For eg;[code]while {$total = 3;}[/code]How would I add all the $total's for each instance that the 'while' was run?I hope this makes sense and I am assuming it is an easy answer..Thanks in advance,Christian Quote Link to comment Share on other sites More sharing options...
jworisek Posted April 14, 2006 Share Posted April 14, 2006 well, you could just do something like this. You do need a condition in your while statment though....[code]$count=0;while ( /*some condition*/ ){$total = 3;$count++;}[/code] Quote Link to comment Share on other sites More sharing options...
Prank Posted April 14, 2006 Author Share Posted April 14, 2006 So that would just add a 1 to the variable $count each time its run?Heres my actual code; [a href=\"http://pastebin.com/658997\" target=\"_blank\"]http://pastebin.com/658997[/a]I need to grab the total value of $total and $qtyThanks for your help. Quote Link to comment Share on other sites More sharing options...
Prank Posted April 14, 2006 Author Share Posted April 14, 2006 nm, i figured it out.. stupidly simple. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted April 14, 2006 Share Posted April 14, 2006 Can you post the solution to your problem, so other people can learn from your experience?BTW, I took a look at your code. Do you realize your creating one form each time you go through the 'while' loop?Ken Quote Link to comment 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.