lilman Posted November 25, 2006 Share Posted November 25, 2006 Is there a way I can code a script so I can export a table in CSV for MS Excel format? Link to comment https://forums.phpfreaks.com/topic/28473-mysql-export-csv-for-ms-excel-using-php/ Share on other sites More sharing options...
Barand Posted November 26, 2006 Share Posted November 26, 2006 Check out SELECT ... INTO OUTFILEhttp://dev.mysql.com/doc/refman/4.1/en/select.html Link to comment https://forums.phpfreaks.com/topic/28473-mysql-export-csv-for-ms-excel-using-php/#findComment-130294 Share on other sites More sharing options...
lilman Posted November 26, 2006 Author Share Posted November 26, 2006 From what I've read, I wrote this code but it doesn't work.$export="SELECT * INTO OUTFILE 'http://localhost/don/spreadsheet.xls' FROM survery";Any help would be great. I am trying to actually export a table into Microsoft Excel 2000. Link to comment https://forums.phpfreaks.com/topic/28473-mysql-export-csv-for-ms-excel-using-php/#findComment-130316 Share on other sites More sharing options...
lilman Posted November 26, 2006 Author Share Posted November 26, 2006 BTW when I run it I get this error:Error Can't create/write to file 'http:\\localhost\don\spreadsheet.xls' (Errcode: 22) with query SELECT * INTO OUTFILE 'http://localhost/don/spreadsheet.xls' FROM survery Link to comment https://forums.phpfreaks.com/topic/28473-mysql-export-csv-for-ms-excel-using-php/#findComment-130328 Share on other sites More sharing options...
Barand Posted November 26, 2006 Share Posted November 26, 2006 Try giving a path on your server instead of a url (C:/pth to file/don/spreadsheet.csv) and make sure you gave write permission Link to comment https://forums.phpfreaks.com/topic/28473-mysql-export-csv-for-ms-excel-using-php/#findComment-130417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.