Returns all field names or field attributes from a table.
array db_list_table_fields(string tablename [, type])
Returns an array with the field names or field attributes, or NULL if no field is found.
// List table fields
$result = db_list_table_fields("mytable");
if ($result !== NULL) {
echo "$result holds the fieldnames";
}