title: MySQL String, check is column exists
body: <p>I am creating something where a column is created for the current date if it does not exist. This is the current query to check for a column name and create one if it does not exist. The variable is <code>$date</code> And this does not work, please can somebody suggest what is wrong with it.</p>
  
  <pre><code>$result = mysqli_query($con,"
      IF NOT EXISTS (
        SELECT * 
        FROM INFORMATION_SCHEMA.COLUMNS
        WHERE TABLE_NAME = 'Scouts' AND COLUMN_NAME = '$date'
      )
      BEGIN
        ALTER TABLE Scouts ADD '$date' VARCHAR( 255 )
      END
  ");
  </code></pre>
  
  <p>SQL injection is not a problem as it is only being hosted on a local machine.
  Sorry if it wasn't clear at first.</p>