Can an array of database table column headings be created?

     

I have a table col-heading whose columns are h1 to h40 and I want to store data in them by using an array of these column headings. Is it possible?


$query = mysql_query("INSERT INTO col_heading(h1---hn) VALUES ('$values')" $connection );  
  
"
answer1
  
  

The question is a little unclear but to get all the column names from a particular table you can try something like this. You will note that it uses mysqli rather than the now deprecated mysql functions.


$dbhost = 'localhost';  $dbname = 'xxx';  $dbpwd = 'xxx';  $dbuser = 'xxx';
$db = new mysqli( $dbhost