So I have been lookin for mistake for a while, but still can't find it.

Here is the code - 

```
        $this->db->select('*');
        $this->db->from('friendRequests');
        $this->db->where(array('friendRequests.status' => 1, 'users.status' => 1)); 
        $this->db->or_where(array('friendRequests.senderId' => $this->session->userdata('userId'), 'friendRequests.receiverId' => $this->session->userdata('userId'))); 
        $this->db->join('users', 'users.id = '.$this->session->userdata('userId'));             
        $query = $this->db->get();

```

It provides me this error - 

```
Unknown column '1' in 'on clause'

SELECT *
  FROM (`friendRequests`) 
  JOIN `users` ON `users`.`id` = `1`
 WHERE `friendRequests`.`status` = 1
   AND `users`.`status` = 1 
    OR `friendRequests`.`senderId` = '1' 
    OR `friendRequests`.`receiverId` = '1'

```