Jump to content

Archived

This topic is now archived and is closed to further replies.

ozorowsky

export mysql data to existing xls file

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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]

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.