Hi, i have a problem export to excel sheet… in the local system it is working but when it comes to server it is not working… as i need to change any settings or anything else?… please get me the ans…
@aj_nscJun 16.2010 — #We'll get you the 'ans', if you tell us what your problem is. What relevant code are you using? What errors are you getting? Basically, what in the world are you talking about?
@ravichegantiauthorJun 19.2010 — #We'll get you the 'ans', if you tell us what your problem is. What relevant code are you using? What errors are you getting? Basically, what in the world are you talking about?[/QUOTE] my problem is when i run the script it is working in the local system i,e it is showing the details in excel but when i run this script in the server means when i upload the file in to server and run it displaying the output in the page but not in the excel sheet...
here is my code...
<?php
include "db.php";
$connection = mysql_connect($host, $username, $pwd) or die ("could't connect to mysql");
$db = mysql_select_db($database, $connection) or die("Couldn't select database.");
$sql = "Select * from $table"; $result = @mysql_query($sql) or die("Couldn't execute query:".mysql_error().''.mysql_errno());
header('Content-Type: application/vnd.ms-excel'); //define header info for browser header('Content-Disposition: attachment; filename='.$table.'-'.date('Ymd').'.xls'); header('Pragma: no-cache'); header('Expires: 0');
for ($i = 0; $i < mysql_num_fields($result); $i++) // show column names as names of MySQL fields echo mysql_field_name($result, $i)."t"; print("n");
while($row = mysql_fetch_row($result)) { //set_time_limit(60); // you can enable this if you have lot of data $output = ''; for($j=0; $j < mysql_num_fields($result); $j++) { if(!isset($row[$j])) $output .= "NULLt";