Q: Saving formatted text from textarea to database Is it possible to save formatted text from a textarea? I have embeded my textarea with a ckeditor plugin, and I was wondering if it is possible to save the formatted text(for example, I changed the font size to 9) in the database? Or do I have to change the datatype of my field other than string?

A: The CKeditor text area will pass HTML when submitted. That's the formatted text. If you output that, it'll be formatted on the page too.

A: OK your not here so let me give you more tips as possible.


*

*Formatting via CKE end inserting full HTML data in your DB is of course possible (and getting data out as HTML page for example via simple string (like $formatted_data for example)). CKE, after submitting your work, is sending full HTML to your database ie(<a href="http://www.example.com" taget="_blank"><font size=2>I love someone</font></a>). CKE does full job about that matter. You just do WYSIWYG (what you see is what you get) work.

*Database filed/column which will save/handle that data should be TEXT.


But, depending on your CMS (core quality) structure, installing CKE may be somewhat complex at start. Even from backend it will give you some (security/DB insert) problems probably - and again - depending on your CMS core structure. You will find many answers here if problems occur how to convert characters given/sent by CKE to DB..
http://www.php.net/manual/en/function.htmlentities.php and here http://www.php.net/manual/en/function.htmlspecialchars.php
Anyway, after echoing CKE data from DB in ie article['formatted_article'] fashion youll get full HTML out. Font sizes, tables, rows, images, urls.. everything. And yea, via single string.
