$result = mysql_query("show columns from mash");
for ($i = 0; $i < mysql_num_rows($result); $i++) {
$colArray[$i] = mysql_fetch_assoc($result);
$fieldArray[$i] = $colArray[$i]['Field'];
}
fputcsv($fp,$fieldArray);
to grab mysql column names and then output them at the top of the created CSV.
However, i know what the column names are going to be, how can i change them for the output in the CSV?
Ie. if the show columns output: id, field1, field2, field3, how can i make these ID, Field 1, Field 2, Field 3. Not just capitalise, but choose what they are going to be...