I am trying to implement Summernote WYSIWYG editor into my form, when i submit the form to write to the mssql table, it accepts most special characters ( $%!< > etc) even double quotes are fine, however when I try and use a single quote I get an sql error come back. Can you help me with what I have missed.
The first line implements the plugin
<textarea name="majorupdate" id="summernote" rows="10" class="form-control"></textarea>
when submitted its Posting it to a second page which uses the following values (taken out some of the irrelevant entries to keep it simple)
$majorupdateX = $_POST['majorupdate'];
$query = mssql_query("INSERT INTO PRJ_Update1 (update1) VALUES ('$majorupdateX') ");
when calling back the entry from the sql table, it is displayed on the page like so
echo '<p>'.$row[update1].'</p>';
I suspect I need to somehow replace the special characters for escaped html equivalents? not sure how best to do that, being new to this I had hoped the summernote text editor would of taken care of that. I tried using the htmlspecialchars() function on the POST value, but had no success. It may be the case I was not using it correctly.
the error
Warning: mssql_query() [function.mssql-query]: message: Line 1: Incorrect syntax near 's'. (severity 15) in C:\WPServer\Web\dev\Rehan\ProjectTracker\PR_projectUpdates1_formpost.php on line 47
Warning: mssql_query() [function.mssql-query]: message: Unclosed quotation mark before the character string ') '. (severity 15) in C:\WPServer\Web\dev\Rehan\ProjectTracker\PR_projectUpdates1_formpost.php on line 47