-<?php \r
+<?php\r
\r
/// $Id $\r
\r
* the "N" notation when working against MSSQL.\r
*\r
* Note that this hack only must be used if ALL the char-based columns in your DB are of type nchar,\r
- * nvarchar and ntext \r
+ * nvarchar and ntext\r
*/\r
function _appendN($sql) {\r
\r
}\r
}\r
\r
+\r
/// Analyse literals to prepend the N char to them if their contents aren't numeric\r
if (!empty($literals)) {\r
foreach ($literals as $key=>$value) {\r
$result = str_replace(array_keys($literals), $literals, $result);\r
}\r
\r
+ /// Any pairs followed by N' must be switched to N' followed by those pairs\r
+ /// (or strings beginning with single quotes will fail)\r
+ $result = preg_replace("/((<@#@#@PAIR-(\d+)@#@#@>)+)N'/", "N'$1", $result);\r
+\r
/// Re-apply pairs of single-quotes to the text\r
if (!empty($pairs)) {\r
$result = str_replace(array_keys($pairs), $pairs, $result);\r
$this->ADORecordset_mssql($id,$mode);\r
}\r
}\r
-?>
\ No newline at end of file
+?>\r