php database excel export
- by user434885
i am using a php script to export datd from mysql into excel.
the first row of the excel sheet is a column headings i want them to appear in bold how do i do this ?
i am using hte 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);