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 ,
i think that (in
uyeOnay
function) :need to be :
Should be