title: PHP Syntax causing results to fail
body: <p>I am currently writing a dummy comment/answer system using PHP/SQL/AJAX and have come an issue on my output divs due to my coding style syntax.</p>
  
  <p>To simplify the code I have just included the while loop:
          //prep query
          $sqlQuery = "SELECT * 
              FROM Questions 
              ORDER BY QuestionID DESC";</p>
  
  <pre><code>    //exec query
      $result = mysql_query($sqlQuery) or die(mysql_error());
  
      //loop for multipule results
          while ($row = mysql_fetch_array($result))
      {
          echo '&lt;div class="test" id="test_$questionID"&gt;'; //&lt;--doesn't work
          //code here
          echo '&lt;/div&gt;';
  
          echo "&lt;div class='test' id='test_$questionID'&gt;"; //&lt;--works
          //code here
          echo '&lt;/div&gt;';
      }
  </code></pre>
  
  <p>Output of failed code line:</p>
  
  <pre><code>&lt;div class="test" id="test_$questionID"&gt;
  </code></pre>
  
  <p>Output of successful code line:</p>
  
  <pre><code>&lt;div class='test' id='test_21'&gt;
  </code></pre>
  
  <p>The code above works when I start an echo using " instead of ' my PHP style is to start each outer with ' and innners with ". </p>
  
  <p>Should I change my div echos to start with " or is there another way?</p>
  
  <p><strong>Edit:</strong> Thanks for all the quick replies all!</p>
  
  <p>I was taught to start using singles instead of doubles without the actual reason behind it. </p>
  
  <p>I didn't know the conflict was caused because of the text being interpreted incorrectly and the environment wasn't throwing any errors to guide. Escaping them as @PressingOnAlways or changing them as @santhy recommend.</p>
  
  <p>It's not that I was asking the difference between singles and doubles since I didn't know that was the area of error. I can see now that it was, but not sure I would have know to look for that stack article first sorry.</p>