Jump to content

Getting a strange error message, can't solve it.


Go to solution Solved by Filip,

Recommended Posts

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: 
 
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 by Filip

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

  • Solution

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.