corillo181 Posted September 22, 2007 Share Posted September 22, 2007 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"; } } } ?> Quote Link to comment Share on other sites More sharing options...
corillo181 Posted September 22, 2007 Author Share Posted September 22, 2007 no takers? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 22, 2007 Share Posted September 22, 2007 $query = "UPDATE users SET activated='y' WHERE code='{$this->code}'"; is the problem... try uh... IDK I hate MySQL lol $query = "UPDATE users *** activated='y' WHERE code='{$this->code}'"; I know set isnt it... Quote Link to comment Share on other sites More sharing options...
corillo181 Posted September 22, 2007 Author Share Posted September 22, 2007 i test the query out of the class and it works, is inside the class that it does not work. Quote Link to comment Share on other sites More sharing options...
corillo181 Posted September 22, 2007 Author Share Posted September 22, 2007 anyways i got it to work just needed to get the update query out of the variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.