dennismonsewicz Posted October 14, 2008 Share Posted October 14, 2008 Code: $who_qry = mysql_query("SELECT * FROM has_had_projects")or die(mysql_error()); $field = mysql_num_fields($who_qry); while($row = mysql_fetch_assoc($who_qry)) { for($i = 3; $i < $field; $i++) { $names = mysql_field_name($who_qry, $i); $numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0); $title[] = str_replace($numbers, '', $names); } } $excel=new ExcelWriter(); foreach ($title as $t) { $excel->writeLine($t); } $excel->send('has_had_projects'); When I run the code and download the file the spreadsheet is empty any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/128404-solved-excel-output-problem/ Share on other sites More sharing options...
dennismonsewicz Posted October 14, 2008 Author Share Posted October 14, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/128404-solved-excel-output-problem/#findComment-665337 Share on other sites More sharing options...
dennismonsewicz Posted October 14, 2008 Author Share Posted October 14, 2008 problem solved! updated working code: $who_qry = mysql_query("SELECT * FROM has_had_projects")or die(mysql_error()); $field = mysql_num_fields($who_qry); while($row = mysql_fetch_assoc($who_qry)) { for($i = 3; $i < $field; $i++) { $names = mysql_field_name($who_qry, $i); $numbers = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 0); $title[] = str_replace($numbers, '', $names); } } $excel=new ExcelWriter(); $excel->writeLine($title); $excel->send('has_had_projects'); Quote Link to comment https://forums.phpfreaks.com/topic/128404-solved-excel-output-problem/#findComment-665339 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.