Filip Posted January 28, 2014 Share Posted January 28, 2014 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 "/> Link to comment https://forums.phpfreaks.com/topic/285741-getting-a-strange-error-message-cant-solve-it/ 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 Link to comment https://forums.phpfreaks.com/topic/285741-getting-a-strange-error-message-cant-solve-it/#findComment-1466844 Share on other sites More sharing options...
Filip Posted January 28, 2014 Author 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 Link to comment https://forums.phpfreaks.com/topic/285741-getting-a-strange-error-message-cant-solve-it/#findComment-1466845 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.