mysql to xls sheet genration problemI(getting html code along with records ,unable get column names)

Posted by pmms on Stack Overflow See other posts from Stack Overflow or by pmms
Published on 2010-04-27T12:15:44Z Indexed on 2010/04/27 12:23 UTC
Read the original article Hit count: 179

Filed under:
|
|
<?php 
      if($_POST['Submit']=='Generatexml')
      {
        $tblname=$_GET['genratexml'];

//mysql_connect("localhost","root","");
//mysql_select_db("hitnrunf_db");

global $obj_mysql;

$result = mysql_query("SELECT * FROM tbl_js_login");

while($row = mysql_fetch_array($result)) {
$csv_output .= "$row[fld_id],$row[fld_fname],$row[fld_lname]";
$csv_output .="\015\012";
}

header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv; filename= Student_Data_". date("Y-m-d") . ".csv");
print $csv_output;
exit;
        }
   include_once $path."includes/jobseeker_form.php";
?>

In the above we are getting html code along wtih id, firstname, lastname columns. we are unable to get the heading of the columns also

How to remove Html code from xls file also need to get headers

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql