title: How do you insert a PHP constant into a SQL query?
body: <p>I have a PHP file with my database configuration settings defined as constants, for example:</p>
  
  <pre><code>&lt;?php
  
  define(DB_HOST,"localhost");
  define(DB_USERNAME,"root");
  define(DB_PASSWORD,"password");
  define(DB_NAME,"db_users");
  define(DB_TABLE_1,"table_1");
  define(DB_TABLE_2,"table_2);
  
  ?&gt;
  </code></pre>
  
  <p>I obviously include the above file whenever I want to connect to my database..However, when I go to insert the table definition constants into the SQL query (see below) it doesn't seem to work. Do I need to properly escape the constant or concatenate it in some way?</p>
  
  <pre><code>$query = "SELECT users FROM DB_TABLE_1";
  </code></pre>