How do you insert an HTML Editor field into another table with sc_exec_sql

I need to be able to store contents of an HTML Editor field.

As part of the form app, storing it works relatively ok except for the issue reported here http://www.scriptcase.net/forum/showthread.php?9821-Pasting-into-HTML-Editor-Field.

I however need to store this in another table into a longtext column. The typical use case is that the contents of the field come from a copy/paste operation from MS Word (and option to store the raw .doc file is not welcome).

With a simple sc_exec_sql statement into the other table this was failing with some MySQL error message. I believe this had to do with (un)escaped characters because once I sanitize the HTML Editor field with macro sc_sql_injection and insert that, it saves with no errors. However with this option, I now have the raw text "
" appearing on all new lines. Before saving the form, the text appears fine.

What’s the most efficient way to deal with this?

Hello,

I think you can use the function “mysql_real_escape_string” for this.