Samurai Legend Posted March 29, 2014 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
Zettieee Posted March 29, 2014 Posted March 29, 2014 += This operator isn't been used right. Just use = Quote
The Coder Posted March 29, 2014 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
Samurai Legend Posted March 30, 2014 Author Posted March 30, 2014 Thank you guys! :) The error is now fixed! Quote
Magictallguy Posted March 30, 2014 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
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.