Jump to content


Photo

Notice: Undefined index


  • Please log in to reply
1 reply to this topic

#1 RicardoNET

RicardoNET
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 08 April 2006 - 06:09 AM

Hello everybody,

its seems to be that one of my script files wont work like it should be anymore, Can somebody help me around with this error;

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Notice: Undefined index: username in C:\WebServer\htdocs\ricardox\user_check.php on line 10[/quote]

The code is;

$user = $_COOKIE['username'];
$sql = mysql_query("SELECT * FROM users WHERE username = '$user'");  // This is line 10
$row = mysql_fetch_array($sql);
$num = mysql_num_rows($sql);

What is the problem right now on this code? Thanks for your solution if you have one!

#2 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 08 April 2006 - 06:29 AM

Undefined index means the the key/index of the array that you are trying to read is not set. $_COOKIE['username'] doesn't exist.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users