MySql query with OR parameter SELECT task_name,task_id,
       SUBSTR(task_text,1,20) AS task_text,
       task_project_id,task_status
    FROM projectboard_tasks
    WHERE task_status IN  ('0','3')
     AND  task_assigner = 31 OR  task_assigned_to = 31


Here in query i return the rows with task status 0 and 3 but due to OR the query returns rows which are not matching the task_status condition 

I get the rows which are not with status 0 or 3 because it match the task_assigner with other rows and shows the result.

Is there any workaround for this ?
You need to apply proper parenthesis ( ). You need to apply parenthesis for the condition (task_assigner = 31 OR task_assigned_to = 31), so the task_status IN ('0', '3') and the task_assigner both conditions will satisfy.

The working query will be:

SELECT task_name, task_id, SUBSTR(task_text, 1, 20) AS task_text,
       task_project_id, task_status
FROM projectboard_tasks
WHERE task_status IN ('0', '3')
    AND (task_assigner = 31 OR task_assigned_to = 31)