Search code examples
mysqltextsavedoc

how to save text in mysql for dynamic site


i am making a site and in the middle of the screen i want to project text. I want the owner of the site to change the text dynamically whenever he wants.

I want the owner to save the text in mysql. The question is what is the correct procedure:

  • let the owner write a doc file -> upload it to server -> with php save the doc file inside mysql ( with the help of load data infile ??? )

or

  • have a textarea in a form -> send the text with post method -> and save it directly in mysal ( but that way i can't have formatted text )

Sorry if my question is vague but i don't have any idea how to approach the whole issue.

Any advice would be really helpful.


Solution

  • First off, you generally won't have formatted text by saving, for instance, a Word doc to a database and retrieving it.. Word formats in a different format than HTML.

    If you want formatted text, I would suggest using a WYSIWYG editor that allows a user to input formatted text into a normal form textarea, and saving the resulting text to the SQL server. You can find many of these editors searching for "wysiwyg html editor" on Google.