ozorowsky Posted October 18, 2005 Share Posted October 18, 2005 I have an existing xls file for my work timesheet, and I'm trying to write code to autopopulate the fields there from mysql database. Anyone out there that can get me pointed in right direction? Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/ Share on other sites More sharing options...
AndyB Posted October 18, 2005 Share Posted October 18, 2005 Not to an xls file directly ... but you can export MySQL data to a CSV file (or any other separator) very easily, and then import the .csv file into Excel. Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8940 Share on other sites More sharing options...
ozorowsky Posted October 18, 2005 Author Share Posted October 18, 2005 could you PLEASE get me started in dummy terms? I really need a newbie tutorial on how to do this. Keep in mind, I have an existing already formatted xls file, and I need the values to be populated with variables from mysql database. Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8949 Share on other sites More sharing options...
ozorowsky Posted October 18, 2005 Author Share Posted October 18, 2005 If it would be helpful I could email you guys the xls file I have. I just don't know what to do. Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8952 Share on other sites More sharing options...
AndyB Posted October 18, 2005 Share Posted October 18, 2005 As far as I know, you can't create a true .xls file using php/MySQL. What you CAN do is generate a text file from the MySQL data. And then you can IMPORT that text file into Excel. Assuming you know how to get the data you want out of your database, you'll find all you need to know about creating a text file in the manual - check fwrite for that. Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8953 Share on other sites More sharing options...
ozorowsky Posted October 19, 2005 Author Share Posted October 19, 2005 I don't have to create an xls file exactly, just something that will print out EXACTLY like what I currently have. Any way I could send you the file I have through email? As far as I know, you can't create a true .xls file using php/MySQL. What you CAN do is generate a text file from the MySQL data. And then you can IMPORT that text file into Excel. Assuming you know how to get the data you want out of your database, you'll find all you need to know about creating a text file in the manual - check fwrite for that. 308060[/snapback] Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8955 Share on other sites More sharing options...
AndyB Posted October 19, 2005 Share Posted October 19, 2005 Any way I could send you the file I have through email? No thanks. The way we all learn is by sharing knowledge. If you want to post some information about your database structure, and some information about what you want in the .csv file that will result from querying it and creating a text file, then everyone here can contribute to the solution you're working towards, and anyone who reads the thread (now or in future) will see how a particular problem was solved. That's what these forums are all about: shared problems, shared solutions. Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8957 Share on other sites More sharing options...
ozorowsky Posted October 19, 2005 Author Share Posted October 19, 2005 Fair enough. I created this: http://rrtools.redirectme.net/Website/timesheet.html with a html table. What I want to do is have pretty much the timesheet there and have values populated then formatted so that it will print out on one page. Right now this table is alittle too big No thanks. The way we all learn is by sharing knowledge. If you want to post some information about your database structure, and some information about what you want in the .csv file that will result from querying it and creating a text file, then everyone here can contribute to the solution you're working towards, and anyone who reads the thread (now or in future) will see how a particular problem was solved. That's what these forums are all about: shared problems, shared solutions. 308083[/snapback] Quote Link to comment https://forums.phpfreaks.com/topic/2689-export-mysql-data-to-existing-xls-file/#findComment-8958 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.