Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

MSSQL Driver with auto-prepended "N" for correct unicode storage of SQL literal strings. Intended to be used with MSSQL drivers that are sending UCS-2 data to MSSQL (FreeTDS and ODBTP) in order to get true cross-db compatibility from the application point of view.

File Size: 250 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

ADODB_mssql_n:: (2 methods):
  _query()
  _appendN()

ADORecordset_mssql_n:: (1 method):
  __construct()


Class: ADODB_mssql_n  - X-Ref

_query($sql,$inputarr=false)   X-Ref
No description

_appendN($inboundData)   X-Ref
This function will intercept all the literals used in the SQL, prepending the "N" char to them
in order to allow mssql to store properly data sent in the correct UCS-2 encoding (by freeTDS
and ODBTP) keeping SQL compatibility at ADOdb level (instead of hacking every project to add
the "N" notation when working against MSSQL.

The orginal note indicated that this hack should only be used if ALL the char-based columns
in your DB are of type nchar, nvarchar and ntext, but testing seems to indicate that SQL server
doesn't seem to care if the statement is used against char etc fields.

param: mixed $inboundData Either a string containing an SQL statement
return: mixed

Class: ADORecordset_mssql_n  - X-Ref

__construct($id,$mode=false)   X-Ref
No description