i want to save a value from a array to a variable .for doing a if condition check . this is my code inside models folder . i got a errormysqli_fetch_array() expects parameter 1 to be mysqli_result, object given .but the $query returns a array value.
public function this_is_try(){
$this->db->select('*');
$this->db->from('partnerprofile');
$this->db->where('User_Id','20');
$query = $this->db->get();
$query->result_array();
$row = mysqli_fetch_array($query);
$user_id = $row['User_Id'];
$agefrom = $row['AgeFrom'];
print $user_id;
exit;
}