Jump to content

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


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 "/>

 

 

 

 

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.