title: SELECT * FROM $_POST[] - PHP mySQL formatting
body: <p>Need help formatting a mySQL query string. The following query returns "parse error, expecting T_STRING or T_VARIABLE"</p>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  
  
  include 'db_connect.php';
  
  mysql_select_db($databaseName, $con);
  
  $query = "SELECT * FROM .$_POST['tab']. WHERE plant_code = .$_POST['plant_code']";
  
  $result = mysql_query($query) or die (mysql_error());
  
  $row = mysql_fetch_assoc($result);
  
  echo json_encode($row);
  
  ?&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$('#profiles_desktops').click(function(){
                  $.post("php/loadProfile.php", {plant_code : selectedSite, tab : "profiles_desktops"}, function(result){ (do something here...) });  });
  </code></pre>