Trying to get a table to print to an excel sheet. All i get is page not found in my browser. I have the link pointing to
shiplistxls.php/shiplistxls.xls
Here is the code for the excel sheet.
<?
Header("Content-Type: application/vnd.ms-excel");
$query_text = "SELECT * FROM shiplist";
$result = mysql_query($query_text);
$fieldcounts = mysql_num_fields($result);
for($i = 0; $i < $fieldcounts; $i++) {
$fieldtype = mysql_fetch_field($result, $i);
echo "$fieldtype->name [$fieldtype->type]\t";
}
echo "\n";
while ($myrow = mysql_fetch_array($result)) {
for($i = 0; $i < $fieldcounts; $i++) {
$fieldname = mysql_field_name($result, $i);
echo "$myrow[$fieldname]\t";
}
echo "\n";
}
?>