Samurai Legend Posted March 29, 2014 Share Posted March 29, 2014 Anyways I can fix this error? A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: stat1 (8) Line executed: /home/samurai/public_html/inventory.php:159 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: stat2 (8) Line executed: /home/samurai/public_html/inventory.php:160 A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined variable: stat3 (8) Line executed: /home/samurai/public_html/inventory.php:161 I tried everything and I couldn't be able to fix it... Line 159 - 161 $stat1+=$i['inv_qty']; $stat2+=$i['itmsellprice']; $stat3+=$i['itmsellprice']*$i['inv_qty']; Quote Link to comment Share on other sites More sharing options...
Zettieee Posted March 29, 2014 Share Posted March 29, 2014 $stats = $var['array']; Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted March 29, 2014 Author Share Posted March 29, 2014 I don't understand? Quote Link to comment Share on other sites More sharing options...
Zettieee Posted March 29, 2014 Share Posted March 29, 2014 += This operator isn't been used right. Just use = Quote Link to comment Share on other sites More sharing options...
The Coder Posted March 29, 2014 Share Posted March 29, 2014 From what I think his saying is... Change to this: $stat1 = $i['inv_qty']; $stat2 = $i['itmsellprice']; $stat3 = $i['itmsellprice']*$i['inv_qty']; Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted March 30, 2014 Author Share Posted March 30, 2014 Thank you guys! :) The error is now fixed! Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted March 30, 2014 Share Posted March 30, 2014 Without first understanding what those variables are used for, simply changing += to = would not be a good idea. What you should've done *above* those three lines was add this: $stat1 = 0; $stat2 = 0; $stat3 = 0; What the code was doing is this: It was trying to add on to a non-set variable 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.