Jump to content

[SOLVED] activation class


corillo181

Recommended Posts

hey i got a code that activate the user profile, but the update is not working is supposed to set the activated from 'n' to 'y'

any one knows what?

<?php
class userActivation{
var $code;
var $id;
var $db;
var $message;

function userActivation($code,$id){
	$this->code = $code;
	$this->id = $id;
	$this->db = new DB();
}

function activate(){
	$query = "SELECT user_id FROM users WHERE user_id='{$this->id}'";
	$result = $this->db->query($query);
	$getid = $this->db->fetch_array($result);
		if($getid['user_id']==$this->id){
			$query = "SELECT code FROM users WHERE code='{$this->code}'";
			$result = $this->db->query($query);
			$getCode = $this->db->fetch_array($result);
				if($getCode['code']==$this->code){
//UPDATE IS NOT WORKING
					$query = "UPDATE users SET activated='y' WHERE code='{$this->code}'";
					$result = $this->db->query($query);
					$this->message = 'your user name has been activated enjoy uploading pictures.';
					}else{
						$this->message = "Your record was not found please contact the administrator about this problem";
					} }else{
						$this->message = "Your record was not found please contact the administrator about this problem";						
					}

}
}

?>

 

Link to comment
Share on other sites

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.