title: Check if column name exist in mysql table
body: <p>i want to check if a particular column is present in my table or not. if it does not exist i want to add it using C programming language.</p>
  
  <p>i tried following code:</p>
  
  <pre><code>mysql_query(sqlhnd, "SELECT * FROM my_table");
  MYSQL_RES *confres = mysql_store_result(sqlhnd);
  int totalrows = mysql_num_rows(confres);
  int numfields = mysql_num_fields(confres);
  MYSQL_FIELD *mfield;
  
  while((row = mysql_fetch_row(confres)))
  {
      for(i = 0; i &lt; numfields; i++)
      {
          char *val = row[i];
          // do something with val...
      }
  }
  </code></pre>
  
  <p>i want to compare val with the column name for example:</p>
  
  <pre><code>if( !strcmp(val,"column")) { create the column using alter table }
  </code></pre>
  
  <p>i am unable to do this part of the code</p>