gah, it feels like i've been trying forever to do this
the table looks like this
and the php code is here
i'm not sure what i'm doing wrong here, i am pretty sure i got everything right
can i get another pair of eyes to look over my code because i'm at the end of my rope here
its supposed to check whatever variable is placed in my activation url
xxxx/users.php?maa=Activate&code=xxx
if it finds a match for xxx then it sets isactive to 1 and code to 0
but it isn't updating the mysql record
the table looks like this
and the php code is here
PHP:
################################################################################
#------------------------------------------------------------------------------#
# Activate Function
#------------------------------------------------------------------------------#
################################################################################
function Activate(){
DBconn();
$code=$_REQUEST['code'];
$result = mysql_query("SELECT userid FROM users WHERE code='$code'");
if(mysql_numrows($result) == 1){
$row=mysql_fetch_row($result);
$query = mysql_query("UPDATE users SET isactive='1',code='0' WHERE userid='$row[userid]'") or die('Could not connect: ' . mysql_error());
echo 'Your account is now active, feel free to login now';
}else{
echo 'You are already activated or error in the database';
}
}
i'm not sure what i'm doing wrong here, i am pretty sure i got everything right
can i get another pair of eyes to look over my code because i'm at the end of my rope here
its supposed to check whatever variable is placed in my activation url
xxxx/users.php?maa=Activate&code=xxx
if it finds a match for xxx then it sets isactive to 1 and code to 0
but it isn't updating the mysql record