# Rich Text Editors and Retrieving SQL Data

**URL:** <https://forum.kirupa.com/t/rich-text-editors-and-retrieving-sql-data/258284>\
**Category:** programming\
**Created:** [April 22, 2008, 6:57pm UTC](https://forum.kirupa.com/t/rich-text-editors-and-retrieving-sql-data/258284 "2008-04-22T18:57:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wispas](https://avatars.discourse-cdn.com/v4/letter/w/9de0a6/32.png) [@wispas](https://forum.kirupa.com/u/wispas)\
**Post date:** [April 22, 2008, 6:57pm UTC](https://forum.kirupa.com/t/rich-text-editors-and-retrieving-sql-data/258284/1 "2008-04-22T18:57:00Z")

</div>

I have built a content management system that manages my database (mysql) articles and am trying to use rich text areas instead of regular text areas. I have followed the tutorial:

[http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm](http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm)

Everything works. I can use the rich text editor to upload new content, but I was wondering if anyone knows how to retrieve the data from the database into the rich text areas when editing the content.

---

<div class="post-metadata">

**Author:** ![djheru](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/djheru/32/3190_2.png) [@djheru](https://forum.kirupa.com/u/djheru)\
**Post date:** [May 13, 2008, 7:29pm UTC](https://forum.kirupa.com/t/rich-text-editors-and-retrieving-sql-data/258284/2 "2008-05-13T19:29:40Z")

</div>

If you are using TinyMCE, I believe that it dynamically replaces a textarea element with the text editor. In that case, just save the db data to a variable, and insert that var in between the open and closing textarea tags. If you are using the object oriented method of generating your rich text editor on the page, I believe it has a method to set the default text. In the examples, they probably use a static string, but you can just replace that with the var you stored the db info in.
