fabiez Posted January 3, 2013 Share Posted January 3, 2013 Hi, I can write in my .xls file but 'n6' doesn't return anything. Help please? <?php require "config.php"; $date = time(); $domain = date('Y_m', $date); $datecase = date('m', $date); $file = $domain . ".xls"; /*datum*/ switch ($datecase) { case 1: $data = "Januari\n"; break; case 2: $data = "Februari\n"; break; case 3: $data = "Mars\n"; break; case 4: $data = "April\n"; break; case 5: $data = "Maj\n"; break; case 6: $data = "Juni\n"; break; case 7: $data = "Juli\n"; break; case 8: $data = "Augusti\n"; break; case 9: $data = "September\n"; break; case 10: $data = "Oktober\n"; break; case 11: $data = "November\n"; break; case 12: $data = "December\n"; break; } $data .= "\n\tNärvaro\t\tAktivt deltagande\t\tKognitivt stöd\t\tSocial samvaro\t\tKommentar\n"; $data .= "1\t\t1\t\t1\t\t1\t\t1\n"; $Result = mysql_query("select n6 from cards where dte='01 2013'", $Link); $Result = mysql_fetch_array($Result); data .= "$Result[n6]\n"; $data .= "2\t\t2\t\t2\t\t2\t\t2\n"; $data .= "3\t\t3\t\t3\t\t3\t\t3\n"; $data .= "4\t\t4\t\t4\t\t4\t\t4\n"; $data .= "5\t\t5\t\t5\t\t5\t\t5\n"; $data .= "6\t\t6\t\t6\t\t6\t\t6\n"; header("Content-Type: application/ms-excel"); header("Content-Disposition: attachment; filename=" . $file); header("Pragma: no-cache"); header("Expires: 0"); print $data; ?> Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/ Share on other sites More sharing options...
Muddy_Funster Posted January 3, 2013 Share Posted January 3, 2013 could you post your table structure please? Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403006 Share on other sites More sharing options...
fabiez Posted January 3, 2013 Author Share Posted January 3, 2013 dte|n1|n2|n3|n4|n5|n6|comment1|ad1|ad2|ad3|ad4|ad5|ad6|comment2|ks1|ks2|ks3|ks4|ks5|ks6|comment3|ss1|ss2|ss3|ss4|ss5|ss6|comment4|comment5|comment6 Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403009 Share on other sites More sharing options...
Muddy_Funster Posted January 3, 2013 Share Posted January 3, 2013 not quite what I was after - can you run DESCRIBE cards and post the results please? Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403011 Share on other sites More sharing options...
fabiez Posted January 3, 2013 Author Share Posted January 3, 2013 (edited) Field Type Null Default Ändra Redigera Kopiera Radera n6 varchar(200) NO NULL Edited January 3, 2013 by fabiez Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403016 Share on other sites More sharing options...
Muddy_Funster Posted January 3, 2013 Share Posted January 3, 2013 (edited) I was looking for information like the following sample I have taken from a table in my sandbox: uid int(11) unsigned NO PRI auto_increment headline varchar(254) NO MUL article text YES postTime timestamp YES MUL CURRENT_TIMESTAMP expireDate date YES MUL postStatus char(1) NO MUL 1 Edt . formating in this new forum really neads some work. Edited January 3, 2013 by Muddy_Funster Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403021 Share on other sites More sharing options...
fabiez Posted January 4, 2013 Author Share Posted January 4, 2013 (edited) it said that there were too many icons. What are you looking for? cause they're all varchar. Edited January 4, 2013 by fabiez Quote Link to comment https://forums.phpfreaks.com/topic/272651-having-trouble-drawing-from-db-to-excel-file/#findComment-1403219 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.