1 | <?php |
---|
2 | /** |
---|
3 | * @version V4.94 23 Jan 2007 (c) 2000-2007 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 | // security - hide paths |
---|
17 | if (!defined('ADODB_DIR')) die(); |
---|
18 | |
---|
19 | |
---|
20 | /* |
---|
21 | The big difference between mssqlpo and it's parent mssql is that mssqlpo supports |
---|
22 | the more standard || string concatenation operator. |
---|
23 | */ |
---|
24 | |
---|
25 | include_once(ADODB_DIR.'/drivers/adodb-mssql.inc.php'); |
---|
26 | |
---|
27 | class ADODB_mssqlpo extends ADODB_mssql { |
---|
28 | var $databaseType = "mssqlpo"; |
---|
29 | var $concat_operator = '||'; |
---|
30 | |
---|
31 | function ADODB_mssqlpo() |
---|
32 | { |
---|
33 | ADODB_mssql::ADODB_mssql(); |
---|
34 | } |
---|
35 | |
---|
36 | function PrepareSP($sql) |
---|
37 | { |
---|
38 | if (!$this->_has_mssql_init) { |
---|
39 | ADOConnection::outp( "PrepareSP: mssql_init only available since PHP 4.1.0"); |
---|
40 | return $sql; |
---|
41 | } |
---|
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); |
---|
46 | } |
---|
47 | |
---|
48 | function _query($sql,$inputarr) |
---|
49 | { |
---|
50 | if (is_string($sql)) $sql = str_replace('||','+',$sql); |
---|
51 | return ADODB_mssql::_query($sql,$inputarr); |
---|
52 | } |
---|
53 | } |
---|
54 | |
---|
55 | class ADORecordset_mssqlpo extends ADORecordset_mssql { |
---|
56 | var $databaseType = "mssqlpo"; |
---|
57 | function ADORecordset_mssqlpo($id,$mode=false) |
---|
58 | { |
---|
59 | $this->ADORecordset_mssql($id,$mode); |
---|
60 | } |
---|
61 | } |
---|
62 | ?> |
---|