how I can replace $this variable in this code? I know that it is incorrect to use $this in functions, but I don't know how I may replace that.
function get_dates($id) {
$class = $this->db->query("SELECT * FROM schedule WHERE class_id='".$id."'");
$class = $class->result_array();
return $class;
}
PS. I don't won't to work with mysql with standart php features and I strongly believe that it is possible to solve this problem with CI featues.
$this(BTW: your missing a$atdb)public function get_dates($id) {does it solve your error? The$thisis actually correct but your context sounds wrong. By the way, your code is vulnerable to SQL injection.