I am not able to get the result when joining two tables with where clause with OR condition I have two tables projects and project_user_cross. I want to get the projects if the user id exists in either of the two tables 

Here is the projects table

Id | project_manager_id | name | description | created_at | updated_at | progress
1  | 1                  | p 1  | lorem ipsum | 2019-9-16  |            | 0


Here is the project_user_cross table (empty)

Id | project_id  | user_id


Here is the query I tried:

SELECT * 
FROM projects p 
INNER JOIN project_user_cross c ON c.project_id = p.id 
WHERE p.project_manager_id =1 OR c.user_id =1


Since project_manager_id = 1 exists I want the query to return the projects but its returning nothing.
The join happens - logically - before the WHERE clause is applied. You can use an EXISTS, moving the join to a subquery:

SELECT p.* 
FROM projects  p
WHERE p.project_manager_id = 1
   OR EXISTS
      ( SELECT 1
        FROM project_user_cross  c
        WHERE c.project_id = p.id 
          AND c.user_id = 1
      ) ;