hi all,
onclick a link i am exporting all details to excel. it's working well.
but when i uploaded this file to my domain and run it,it is fetching data but not all data, columns are exporing to excel but only first 3 value are exporting to excel.
any idea for this appre..
thankx
$cdate = date("Y-m-d"); // get current date
include("class/config.php");
$obj=new process();
$obj->connection();
$query_string = "SELECT user_register.user_id as Sno,job_apply,name as Name,Email,Country,Age,Address,Cno as ContactNumber,Mno as MobileNumber,Gender,Date_register as RegisterDate,filename as Document FROM user_register join user_upload on user_register.user_id=user_upload.user_id";
$export_filename = "report_$cdate.xls";
$result = mysql_query($query_string);
$count = mysql_num_fields($result);
$header = '';
for ($i = 0; $i < $count; $i++){
$header .= mysql_field_name($result, $i)."\t";
}
while($row = mysql_fetch_row($result)){
$line = '';
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = "\t";
}else{
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}
$data = str_replace("\r", "", $data);
if ($data == "") {
$data = "\nNo Data Found\n";
}
// create table header showing to download a xls (excel) file
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=$export_filename");
header("Cache-Control: public");
header("Content-length: ".strlen($data)); // tells file size
header("Pragma: no-cache");
header("Expires: 0");
// output data
echo $header."\n".$data;