title: How to fix my query
body: <p>I have the following query:</p>
  
  <pre><code>SELECT table_a.field1, table_b.field1
  FROM table_a, table_c
  LEFT JOIN table_b
  ON table_a.field1=table_b.field1
  WHERE table_a.field2 LIKE ?
  AND table_a.field3 = ?
  AND table_a.field4 = ?
  AND table_b.field1 IS NULL
  AND table_c.id = table_b.c_id
  AND table_c.field1 = ?
  AND table_c.field2 = ?
  AND table_c.field3 = ?
  </code></pre>
  
  <p>However when executed I get the following error:</p>
  
  <pre><code>o: SQLSTATE[42P01]: Undefined table: 7 ERROR:  invalid reference to FROM-clause entry for table "table_a" at character 114
  HINT:  There is an entry for table "table_a", but it cannot be referenced from this part of the query.
  </code></pre>
  
  <p>I'm using PostgreSQL and PDO.</p>
  
  <p>Any idea how to fix this / what's wrong with my query?</p>