title: Difference between inline SQL and selecting from view
body: <p>Are there any significant performance differences in PHP and MySQL between 'building' an SQL statement inline (or 'hard-coding' it) and selecting from a MySQL view?</p>
  
  <p>For example:</p>
  
  <pre><code>$sql = "SELECT `table1`.`field1`,`table1`.`field2`,`table2`.`field1`,`table2`.`field2` 
          FROM `table1` 
              RIGHT JOIN `table2` On `table1`.`field1` = `table2`.`field1`;";
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>$sql = "SELECT * FROM `view1`;";
  </code></pre>
  
  <p>where <code>view1</code> is actually the same statement.</p>