title: Check if column exists, if not, add in MySQL through PHP
body: <p>I'm using the following code to check if the column exists, and if it doesn't, add it:</p>
  
  <pre><code>mysql_query("select $column from $table") or mysql_query("alter table $table add $column varchar (20)");
  </code></pre>
  
  <p>But there's no change in the database. Any suggestions why?</p>
  
  <p>P.S. The database is connected.</p>