• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Quick PHP question

Supermercado

Diamond Member
Okay, I've got a fairly sizeable MySQL database for a project a friend and I are working on. Once everything is into our database, I want to write a script that will allow us to generate an MS Word document of all of the things in our database. There's 7 different tables in the database, all storing different, but similar data. I want to basically go through each table, get all the information and then come up with an alphabetically sorted list (with the name in bold or something and the rest of the text from each entry following) of everything. That much I know I can do. My question, I guess, is this: is there any function that I don't know about that can help me do this? Something with string formatting (bold text and indentation in the Word document, for example). I haven't actually tried it but I imagine that I could just do standard file writing and have the name of the file be *.doc and it would be considered a Word document. But that's only half of what I ultimately want.

I guess the cliffs notes are: is this any function that can help me create an MS Word document from a MySQL database, with the ability to do full text formatting in the Word document?

Thanks.
 
The closest I know of that you could do would be to use wv. But I'm not even sure if it goes in that direction or even if it's been ported to Windows.

Trust me, you would be better served by creating an (X)HTML file from the data in question. You could then import into Word if you really, really need to.
 
Ah, I think I see what you mean. Just create a file with a .html extension so I can use the HTML text formatting codes and whatnot to do what I need to. And that could be opened up (I assume that importing displays the text as if it was being displayed in a browser?) in Word? Actually, creating an HTML document would probably be just as good as a Word document and probably better, now that I think about it. We're creating all the information for our database in Word and then putting it in via a big script that I wrote and then displaying it via another script. We have no need to modify the data so it doesn't necessarily have to be in Word. I just thought that'd be best, but now that you bring it up, an HTML document would probably be much better.

That probably doesn't make much sense... but the idea is create an HTML document and import into Word so it displays the HTML formatting. Or view it in a browser. That's a good idea and should accomplish exactly what I want. The whole idea is just to have one big document with all of our information in it stored locally in an easily-browsable format.

I think your suggestion should get me going. Thanks for your help.
 
Back
Top