Part of the EllisLab Network
   
 
How do I make a text editor like TinyMCE Work with a Database?
Posted: 21 December 2009 04:51 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

How Am I Supposed to edit text that is located in a database from a text editor like TinyMCE
Just asking? :]

Profile
 
 
Posted: 21 December 2009 05:22 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  804
Joined  06-10-2009

Step 1- get text from database.
Step 2- echo it out as content in the TinyMCE textarea of your form.
Step 3- receive submitted content, clean it, and store it back in database.

 Signature 

CreativeHalls Web Design and Printing
A few of my projects:
OurGulfCoast Property Management and Vacation Rental (ASP/.NET)
BukuBux - Money Saving Coupons and Gift Certificates (CodeIgniter, LAMP/MySQL)
Rentals800.com - Find a place to rent (CodeIgniter, LAMP/MySQL)
bdh (dot) hall (at) gmail (dotcom)

Profile
 
 
Posted: 21 December 2009 06:32 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

Okay lets see if I can do it :]

$this->db->get('content');//for the sake of simpleness

//view file.
[TinyMCE Text Area] echo $content //I know how to put it there... 

now what? >_<

Profile
 
 
Posted: 21 December 2009 07:15 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  33
Joined  03-04-2006

What do you mean now what?

Profile
 
 
Posted: 21 December 2009 07:17 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

How I’m I supposed to enter the modified text into the database? :(

Profile
 
 
Posted: 21 December 2009 07:21 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  15
Joined  12-16-2009

I don’t have any experience with TinyMCE but doesn’t it just extend a standard Form textarea? If it does, then just process the form like you would any other standard form on your site.

Profile
 
 
Posted: 21 December 2009 07:24 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

You mean changing the action to a mysql insert function? (Update in this case)

Profile
 
 
Posted: 21 December 2009 07:36 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  15
Joined  12-16-2009
Alfredor - 22 December 2009 12:24 AM

You mean changing the action to a mysql insert function? (Update in this case)

The action should be a controller action that will call an “update” function in a model to process all the posted data and update your database.

Try watching this and applying the concepts in it to what you are doing:

CRUD Screencast

Profile
 
 
Posted: 21 December 2009 08:06 PM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

Interesting SC, I’m watching anyways, does anyone wonders why is the PECL website not working? ._. Its weird.

Profile
 
 
Posted: 28 December 2009 01:24 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  48
Joined  10-20-2009

Hey everyone!, I got it working wonderfully here is an screenshot.
ScreenShot

Profile