Welcome Guest, Not a member yet? Register   Sign In
How do I make a text editor like TinyMCE Work with a Database?
#1

[eluser]Alfredor[/eluser]
How Am I Supposed to edit text that is located in a database from a text editor like TinyMCE
Just asking? :]
#2

[eluser]BrianDHall[/eluser]
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.
#3

[eluser]Alfredor[/eluser]
Okay lets see if I can do it :]

Code:
$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? >_<
#4

[eluser]ecsyle31[/eluser]
What do you mean now what?
#5

[eluser]Alfredor[/eluser]
How I'm I supposed to enter the modified text into the database? Sad
#6

[eluser]dchuk[/eluser]
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.
#7

[eluser]Alfredor[/eluser]
You mean changing the action to a mysql insert function? (Update in this case)
#8

[eluser]dchuk[/eluser]
[quote author="Alfredor" date="1261459453"]You mean changing the action to a mysql insert function? (Update in this case)[/quote]

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
#9

[eluser]Alfredor[/eluser]
Interesting SC, I'm watching anyways, does anyone wonders why is the PECL website not working? ._. Its weird.
#10

[eluser]Alfredor[/eluser]
Hey everyone!, I got it working wonderfully here is an screenshot.
ScreenShot




Theme © iAndrew 2016 - Forum software by © MyBB