Filip Posted January 28, 2014 Share Posted January 28, 2014 (edited) Hello ! Currently I'm having some major issues with my php code that giving a strange error message that I can't solve. What my code will do is simply be able to change databas information without accesing phpmyadmin. Code: http://pastebin.com/swLN78vE Error message: Notice: Undefined variable: kunder in D:\wamp\www\projekt\modify.php on line 16 Call Stack #TimeMemoryFunctionLocation 10.0005253784{main}( )..\modify.php:0 "/> Notice: Undefined variable: kunder in D:\wamp\www\projekt\modify.php on line 18 Call Stack #TimeMemoryFunctionLocation 10.0005253784{main}( )..\modify.php:0 "/> Edited January 28, 2014 by Filip Quote Link to comment Share on other sites More sharing options...
denno020 Posted January 28, 2014 Share Posted January 28, 2014 The error is telling you that there is an unknown variable being used, kunder, aka $kunder. If you look on line 16, you will see that you're trying to access $kunder as an array, however $kunder is not initialised anywhere, and therefore, is undefined. Denno Quote Link to comment Share on other sites More sharing options...
Solution Filip Posted January 28, 2014 Author Solution Share Posted January 28, 2014 Thanks you Denno!! I did a big miss I had to change out this one if(!isset($_POST['submit'])){ $q = "SELECT * FROM kunder WHERE ID = $_GET[id]"; $result = mysql_query($q); $person= mysql_fetch_array($result); } to: if(!isset($_POST['submit'])){ $q = "SELECT * FROM kunder WHERE ID = $_GET[id]"; $result = mysql_query($q); $kunder = mysql_fetch_array($result); } Simple works now! thanks <33 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.