Jump to content

textarea being truncated on the way to MySQL


Plexicle

Recommended Posts

Hello PHP geniuses,

 

I'm having a bit of trouble here. I've built a WYSIWYG e-mail editor with the help of TinyMCE. I'm using a textarea to pull the innerHTML from the iframe where the actual editor is.

 

The textarea will be hidden in production, but it's shown now for debugging reasons. I have a JS function that grabs the HTML from the iframe and puts it into the textarea, and this works great. The entire HTML gets populated in the textarea. When I go to save the e-mail (using a simple query that posts it and sends it straight to the database). The HTML is truncated in the database field to around ~255 characters. (it varies depending on what I have in there, but it's usually between 252 and 255)

 

I really can't figure out why this would be cutting off like this. I've looked everywhere, I don't know what else to do.

 

 

I wanted to add that the field is a text field in the database, that was the first and most obvious thing to check. I can confirm that my database holds the full text no problem. I can go into phpMyAdmin and copy+paste infinite amounts of data into the html field and it saves it without an issue.

 

 

Thank you as always <3

 

If you need more information to help me, I will provide whatever helps.

Can you show us your table structure?

Im thinking you are using a varchar. varchar columns can only hold a maximum of 255 characters :)

 

Thanks for the reply Buddski. :)

 

I want to point out something I said in the original post, however:

 

I wanted to add that the field is a text field in the database, that was the first and most obvious thing to check. I can confirm that my database holds the full text no problem. I can go into phpMyAdmin and copy+paste infinite amounts of data into the html field and it saves it without an issue.

 

I appreciate your help either way!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.