Here is a little function I made in PHP to look for single quotes and doubling them so that they would be escaped (thus allowing the content to be inserted into MSSQL).
//********************************
// fix quotes for mssql
//********************************
function mssql_quote_fix($text)
{
$text = str_replace("'", "''", $text);
return $text;
}
Just call this function on the text you're trying to insert.
I'll give a little credit to this article for helping me: Escape Character In Microsoft SQL Server 2000
No comments:
Post a Comment