Code returns:
Notice: Undefined offset: 0 line 60
Notice: Undefined offset: 1 line 61
Notice: Undefined offset: 2 line 62
I don't know where is a mistake. I have no idea, so I need some help.
Part of code is below:
private function action($action, $table, $where = array()) {
if(count($where) === 3) {
$operators = array('=','>','<','>=' ,'<=');
$field = $where[0]; //-----> LINE 60
$operator = $where[1]; //-----> LINE 61
$value = $where[2]; //-----> LINE 62
if(in_array($operator, $operators)) {
$sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?";
if(!$this->query($sql, array($value))->error()) {
return $this;
}
}
}
return false;
}