I am using a PHP script to export data from MySQL into Excel. The first row of the Excel sheet is a column heading. I want them to appear in bold. How do I do this? I am using the following code:
$con = mysql_connect("localhost","admin","password");
if (!$con)
{
die('Could not connect to DB: \n' . mysql_error());
}
mysql_select_db("ALNMSI", $con);
$result = mysql_query("SELECT * FROM survey1");
$filename = "alnmsi_" . date('d-m-Y') . ".xls";
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: application/vnd.ms-excel"); $flag = false;
$flag = false;
while($row = mysql_fetch_array($result))
{
if(!$flag)
{
data_keys();
$flag = true;
}
array_walk($row, 'cleanData');
data_array($row);
}