title: PHP/mySQL: How do a concatenate a variable in a mysql query?
body: <p>What is the proper way to concatenate text and a variable in PHP inside a mysql_query? Here is my attempt:</p>
  
  <pre><code>page.'$pageID'
  </code></pre>
  
  <p>I want it to output <code>page3</code>.</p>
  
  <p>Here is all of the code (simplified to focus on the mysql_query):</p>
  
  <pre><code>if ($_POST['pageProgress']) {
          $pageProgress = $_POST['pageProgress'];
          $pageID = 3;
          $userID = 1;
          $updateUserProgress = mysql_query("UPDATE test SET page.'$pageID'='$pageProgress' WHERE userID='$userID'") or die(mysql_error());
      }
  </code></pre>
  
  <p>All of the code works perfectly if I simply replace <code>page.'$pageID'</code> with <code>page3</code>.</p>