title: MySQL query nested query
body: <p>I`m trying to run a nested query on MySQL (phpmyadmin) and via PHP, and both result in the same output which is incorrect.</p>
  
  <p>NOTE: Table name have been clipped due to sensitivity of project</p>
  
  <pre><code>SELECT * FROM `table1` WHERE ID="SELECT `field1` FROM `table2` WHERE ID=1"
  </code></pre>
  
  <p>This returns zero rows, although each query alone gives a valid output as below</p>
  
  <pre><code>SELECT `field1` FROM `table2` WHERE ID=1
  </code></pre>
  
  <p>Gives the required output, and this output when used in the first part of the main query provides also what is required. Please help.</p>