Plexicle Posted October 3, 2011 Share Posted October 3, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/248328-textarea-being-truncated-on-the-way-to-mysql/ Share on other sites More sharing options...
Buddski Posted October 3, 2011 Share Posted October 3, 2011 Can you show us your table structure? Im thinking you are using a varchar. varchar columns can only hold a maximum of 255 characters Quote Link to comment https://forums.phpfreaks.com/topic/248328-textarea-being-truncated-on-the-way-to-mysql/#findComment-1275196 Share on other sites More sharing options...
Plexicle Posted October 3, 2011 Author Share Posted October 3, 2011 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! Quote Link to comment https://forums.phpfreaks.com/topic/248328-textarea-being-truncated-on-the-way-to-mysql/#findComment-1275198 Share on other sites More sharing options...
Buddski Posted October 3, 2011 Share Posted October 3, 2011 Had to ask Can you show us the code you are using to insert your data? Quote Link to comment https://forums.phpfreaks.com/topic/248328-textarea-being-truncated-on-the-way-to-mysql/#findComment-1275200 Share on other sites More sharing options...
AbraCadaver Posted October 3, 2011 Share Posted October 3, 2011 Also, are you using mysql_real_escape_string() or prepared statements to escape and insert the data? Quote Link to comment https://forums.phpfreaks.com/topic/248328-textarea-being-truncated-on-the-way-to-mysql/#findComment-1275280 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.