title: Use a $variable inside a SQL string?
body: <p>I would like to be able to select a category from a dropdown and depending on the category it will add it to whatever SQL table is it equal with.</p>
  
  <pre><code>&lt;?php
  
  $article = $_POST['article'];
  
  $con = mysql_connect("******","******","*******");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("jstaltso_staltsoft", $con);
  
  $sql="INSERT INTO $article (headline, content)
  VALUES ('$_POST[headline]', '$_POST[content]')";
  
  if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }
  echo "Content Added!";
  echo "&lt;br/&gt;";
  echo "&lt;a href='articles.php'&gt;&lt;- Back&lt;/a&gt;";
  
  mysql_close($con)
  
  ?&gt;
  </code></pre>
  
  <p>I want the variable $articles to be in the place of where you out the name of the table.</p>
  
  <pre><code>$sql="INSERT INTO $article (headline, content)
  VALUES ('$_POST[headline]', '$_POST[content]')";
  </code></pre>
  
  <p>So whatever I choose in the dropdown, it will put it at $articles.</p>