Merge branch 'MDL-33441' of git://github.com/danpoltawski/moodle
[moodle.git] / lib / adodb / drivers / adodb-mssqlpo.inc.php
blob76dfe245a213ba742b1ce974d90c378cfbc1a24a
1 <?php
2 /**
3 * @version V5.16 26 Mar 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
4 * Released under both BSD license and Lesser GPL library license.
5 * Whenever there is any discrepancy between the two licenses,
6 * the BSD license will take precedence.
8 * Set tabs to 4 for best viewing.
10 * Latest version is available at http://php.weblogs.com
12 * Portable MSSQL Driver that supports || instead of +
16 // security - hide paths
17 if (!defined('ADODB_DIR')) die();
21 The big difference between mssqlpo and it's parent mssql is that mssqlpo supports
22 the more standard || string concatenation operator.
25 include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php');
27 class ADODB_mssqlpo extends ADODB_mssql {
28 var $databaseType = "mssqlpo";
29 var $concat_operator = '||';
31 function ADODB_mssqlpo()
33 ADODB_mssql::ADODB_mssql();
36 function PrepareSP($sql)
38 if (!$this->_has_mssql_init) {
39 ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0");
40 return $sql;
42 if (is_string($sql)) $sql = str_replace('||','+',$sql);
43 $stmt = mssql_init($sql,$this->_connectionID);
44 if (!$stmt) return $sql;
45 return array($sql,$stmt);
48 function _query($sql,$inputarr=false)
50 if (is_string($sql)) $sql = str_replace('||','+',$sql);
51 return ADODB_mssql::_query($sql,$inputarr);
55 class ADORecordset_mssqlpo extends ADORecordset_mssql {
56 var $databaseType = "mssqlpo";
57 function ADORecordset_mssqlpo($id,$mode=false)
59 $this->ADORecordset_mssql($id,$mode);