title: When to use single quotes, double quotes, and backticks in MySQL
body: <p>I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double quotes, and backticks without any real thought.</p>
  
  <p>Example:</p>
  
  <pre><code>$query = 'INSERT INTO table (id, col1, col2) VALUES (NULL, val1, val2)';
  </code></pre>
  
  <p>Also, in the above example, consider that <code>table</code>, <code>col1</code>, <code>val1</code>, etc. may be variables.</p>
  
  <p>What is the standard for this? What do you do?</p>
  
  <p><sub>I've been reading answers to similar questions on here for about 20 minutes, but it seems like there is no definitive answer to this question.</sub></p>