title: PHP Mysql - Use a variable as column name in Select statement
body: <p>I have month names as column names such as jan, feb, march, etc. in my table.<br />
  In my Form user needs to choose a month from drop down which I take the user's selection
  as $month_name. <br /><br />I want to see the data in $month_name which is not 0.00.</p>
  
  <p>When I echo $month_name I get: jan or feb or etc.</p>
  
  <p>I used $month_name in my select statement but not working:<br /><br />
  1st try not working:</p>
  
  <pre><code>$sql = "SELECT * FROM bookoff_monthly WHERE '.$month_name.' &lt;&gt; 0.00 AND year='$year' ";
  </code></pre>
  
  <p>2nd try not working:</p>
  
  <pre><code>$sql = "SELECT * FROM bookoff_monthly WHERE $month_name &lt;&gt; 0.00 AND year='$year' ";
  </code></pre>
  
  <p><b>** </b>but the following works but this isn't what I want:<br /></p>
  
  <pre><code>$sql = "SELECT * FROM bookoff_monthly WHERE jan &lt;&gt; 0.00 AND year='$year' ";
  </code></pre>