ERROR MESSAGE: Notice: Use of undefined constant --- help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

ERROR MESSAGE: Notice: Use of undefined constant --- help

Post by tecktalkcm0391 »

I am trying to get this to work but i keep getting this message:
Notice: Use of undefined constant query5 - assumed 'query5' in /home/website/public_html/dir/Login/process.php on line 158
Here is the code I am using:

Code: Select all

<?php 

$username = 'test';
$pass = '1234';
// Create Activation Code 

$activationcode = rand(1111111,999999);


$query5 = @mysql_query("UPDATE database SET Code = '{$code}' WHERE User = '{$username}' AND Pass= '{$pass}'"); 
	   }
// Finish query	   
   if(!query5)
   {  
   	   return "An error has occurred. ";
                 
   } else { 

// codes 
}
?>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

And there on line 158 is this:

Code: Select all

if(!query5)
which should be $query5 based on the previous line.
(#10850)
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

thanks, I didn't catch that!
Post Reply