1

I try to activate to the registered user's account.

In order to that first create a model

function uyeOnay($registrationCode) {
    $query = "SELECT id FROM pasaj_register where activationCode = '" . $registrationCode . "'";
    $result = $this->db->query($query, $registrationCode);

    if ($result->num_rows() == 1) {
        $query = "UPDATE pasaj_register SET activated = 1 WHERE activationCode = ?";
        $this->query->query($query, $registrationCode);

        return true;
    } else {
        return false;
    }
}

then i called it in my controller

public function kayitEmailOnay() {

        $registrationCode = $this->uri->segment(3);

        if ($registrationCode == '') {
            echo "URLde onay kodu yok";
        }


        $registrationConfirmed = $this->kayitmodel->uyeOnay($registrationCode);

        if ($registrationConfirmed)
            echo "successful";
        else
            echo "unsuccessful";
    }

i also called my model in constructor

public function __construct() {
        parent::__construct();

        $this->load->model('kayitmodel');
    }

However, i get this error ,

enter image description here

2 Answers 2

1

i think that (in uyeOnay function) :

$this->query->query($query, $registrationCode);

need to be :

$this->db->query($query, $registrationCode);
Sign up to request clarification or add additional context in comments.

Comments

1
$this->query->query($query, $registrationCode);

Should be

$this->db->query($query, $registrationCode);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.