title: How to select column names dynamically in mySQL
body: <p>I want to select column names but I don't know the table structure ahead of time and it may change so I can't just hard code the select statement with column names. I also do NOT want to select every column. Is there and easy way to do this?</p>
  
  <p>My thoughts are it's some kind of combination of these two queries but my SQL is not that good.</p>
  
  <pre><code>SHOW COLUMNS FROM table_name;
  SELECT * FROM table_name; 
  </code></pre>
  
  <p>I tried using a sub select but it didn't work. Nothing seems to happen, I don't get an error I just get no results</p>
  
  <pre><code>SELECT (SELECT column_name 
          FROM information_schema.columns 
          WHERE table_name ='table_name') 
  FROM table_name;
  </code></pre>
  
  <p>Maybe I need to do a join?.. 
  Anyway any help would be great, thanks</p>