Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

   1  <?php
   2  /**
   3  * @version   v5.21.0  2021-02-27
   4  * @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
   5  * @copyright (c) 2014      Damien Regad, Mark Newnham and the ADOdb community
   6  * Released under both BSD license and Lesser GPL library license.
   7  * Whenever there is any discrepancy between the two licenses,
   8  * the BSD license will take precedence.
   9  *
  10  * Set tabs to 4 for best viewing.
  11  *
  12  * Latest version is available at https://adodb.org/
  13  *
  14  *  Portable MSSQL Driver that supports || instead of +
  15  *
  16  */
  17  
  18  // security - hide paths
  19  if (!defined('ADODB_DIR')) die();
  20  
  21  
  22  /*
  23  	 The big difference between mssqlpo and it's parent mssql is that mssqlpo supports
  24  	 the more standard || string concatenation operator.
  25  */
  26  
  27  include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php');
  28  
  29  class ADODB_mssqlpo extends ADODB_mssql {
  30  	 var $databaseType = "mssqlpo";
  31  	 var $concat_operator = '||';
  32  
  33  	function PrepareSP($sql, $param = true)
  34  	 {
  35  	 	 if (is_string($sql)) $sql = str_replace('||','+',$sql);
  36  	 	 $stmt = mssql_init($sql,$this->_connectionID);
  37  	 	 if (!$stmt)  return $sql;
  38  	 	 return array($sql,$stmt);
  39  	 }
  40  
  41  	function _query($sql,$inputarr=false)
  42  	 {
  43  	 	 if (is_string($sql)) $sql = str_replace('||','+',$sql);
  44  	 	 return ADODB_mssql::_query($sql,$inputarr);
  45  	 }
  46  }
  47  
  48  class ADORecordset_mssqlpo extends ADORecordset_mssql {
  49  	 var $databaseType = "mssqlpo";
  50  }