]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php
Reformat code
[SourceForge/phpwiki.git] / lib / WikiDB / adodb / drivers / adodb-mssqlpo.inc.php
1 <?php
2 /**
3  * @version V4.22 15 Apr 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). 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.
7  *
8  * Set tabs to 4 for best viewing.
9  *
10  * Latest version is available at http://php.weblogs.com
11  *
12  *  Portable MSSQL Driver that supports || instead of +
13  *
14  */
15
16 /*
17     The big difference between mssqlpo and it's parent mssql is that mssqlpo supports
18     the more standard || string concatenation operator.
19 */
20
21 include_once(ADODB_DIR . '/drivers/adodb-mssql.inc.php');
22
23 class ADODB_mssqlpo extends ADODB_mssql
24 {
25     var $databaseType = "mssqlpo";
26     var $concat_operator = '||';
27
28     function ADODB_mssqlpo()
29     {
30         ADODB_mssql::ADODB_mssql();
31     }
32
33     function PrepareSP($sql)
34     {
35         if (!$this->_has_mssql_init) {
36             ADOConnection::outp("PrepareSP: mssql_init only available since PHP 4.1.0");
37             return $sql;
38         }
39         if (is_string($sql)) $sql = str_replace('||', '+', $sql);
40         $stmt = mssql_init($sql, $this->_connectionID);
41         if (!$stmt) return $sql;
42         return array($sql, $stmt);
43     }
44
45     function _query($sql, $inputarr)
46     {
47         if (is_string($sql)) $sql = str_replace('||', '+', $sql);
48         return ADODB_mssql::_query($sql, $inputarr);
49     }
50 }
51
52 class ADORecordset_mssqlpo extends ADORecordset_mssql
53 {
54     var $databaseType = "mssqlpo";
55
56     function ADORecordset_mssqlpo($id, $mode = false)
57     {
58         $this->ADORecordset_mssql($id, $mode);
59     }
60 }