Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Greg Aker | 741de1c | 2010-11-10 14:52:57 -0600 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.1.6 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
Greg Aker | 0defe5d | 2012-01-01 18:46:41 -0600 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
| 27 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 28 | /** |
| 29 | * MS SQL Database Adapter Class |
| 30 | * |
| 31 | * Note: _DB is an extender class that the app controller |
| 32 | * creates dynamically based on whether the active record |
| 33 | * class is being used or not. |
| 34 | * |
| 35 | * @package CodeIgniter |
| 36 | * @subpackage Drivers |
| 37 | * @category Database |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 38 | * @author EllisLab Dev Team |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 39 | * @link http://codeigniter.com/user_guide/database/ |
| 40 | */ |
| 41 | class CI_DB_mssql_driver extends CI_DB { |
| 42 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 43 | public $dbdriver = 'mssql'; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 44 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 45 | // The character used for escaping |
Andrey Andreev | dd7242b | 2012-01-26 00:43:38 +0200 | [diff] [blame] | 46 | protected $_escape_char = ''; |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 47 | |
| 48 | // clause and character used for LIKE escape sequences |
Andrey Andreev | dd7242b | 2012-01-26 00:43:38 +0200 | [diff] [blame] | 49 | protected $_like_escape_str = ' ESCAPE \'%s\' '; |
| 50 | protected $_like_escape_chr = '!'; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 51 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 52 | /** |
| 53 | * The syntax to count rows is slightly different across different |
| 54 | * database engines, so this string appears in each driver and is |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 55 | * used for the count_all() and count_all_results() methods. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 56 | */ |
Andrey Andreev | dd7242b | 2012-01-26 00:43:38 +0200 | [diff] [blame] | 57 | protected $_count_string = 'SELECT COUNT(*) AS '; |
| 58 | protected $_random_keyword = ' NEWID()'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * Non-persistent database connection |
| 62 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 63 | * @return resource |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 64 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 65 | public function db_connect() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 66 | { |
| 67 | if ($this->port != '') |
| 68 | { |
| 69 | $this->hostname .= ','.$this->port; |
| 70 | } |
| 71 | |
| 72 | return @mssql_connect($this->hostname, $this->username, $this->password); |
| 73 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 74 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 75 | // -------------------------------------------------------------------- |
| 76 | |
| 77 | /** |
| 78 | * Persistent database connection |
| 79 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 80 | * @return resource |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 81 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 82 | public function db_pconnect() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 83 | { |
| 84 | if ($this->port != '') |
| 85 | { |
| 86 | $this->hostname .= ','.$this->port; |
| 87 | } |
| 88 | |
| 89 | return @mssql_pconnect($this->hostname, $this->username, $this->password); |
| 90 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 91 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 92 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 93 | |
Derek Jones | 87cbafc | 2009-02-27 16:29:59 +0000 | [diff] [blame] | 94 | /** |
| 95 | * Reconnect |
| 96 | * |
| 97 | * Keep / reestablish the db connection if no queries have been |
| 98 | * sent for a length of time exceeding the server's idle timeout |
| 99 | * |
Derek Jones | 87cbafc | 2009-02-27 16:29:59 +0000 | [diff] [blame] | 100 | * @return void |
| 101 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 102 | public function reconnect() |
Derek Jones | 87cbafc | 2009-02-27 16:29:59 +0000 | [diff] [blame] | 103 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 104 | // Not supported in MSSQL |
Derek Jones | 87cbafc | 2009-02-27 16:29:59 +0000 | [diff] [blame] | 105 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 106 | |
Derek Jones | 87cbafc | 2009-02-27 16:29:59 +0000 | [diff] [blame] | 107 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 108 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 109 | /** |
| 110 | * Select the database |
| 111 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 112 | * @return bool |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 113 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 114 | public function db_select() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 115 | { |
| 116 | // Note: The brackets are required in the event that the DB name |
| 117 | // contains reserved characters |
| 118 | return @mssql_select_db('['.$this->database.']', $this->conn_id); |
| 119 | } |
| 120 | |
| 121 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 122 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 123 | /** |
| 124 | * Set client character set |
| 125 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 126 | * @param string |
| 127 | * @param string |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 128 | * @return bool |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 129 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 130 | public function db_set_charset($charset, $collation) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 131 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 132 | // Not supported in MSSQL |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 133 | return TRUE; |
| 134 | } |
| 135 | |
| 136 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 137 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 138 | /** |
| 139 | * Execute the query |
| 140 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 141 | * @param string an SQL query |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 142 | * @return mixed resource if rows are returned, bool otherwise |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 143 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 144 | protected function _execute($sql) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 145 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 146 | return @mssql_query($this->_prep_query($sql), $this->conn_id); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 147 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 148 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 149 | // -------------------------------------------------------------------- |
| 150 | |
| 151 | /** |
| 152 | * Prep the query |
| 153 | * |
| 154 | * If needed, each database adapter can prep the query string |
| 155 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 156 | * @param string an SQL query |
| 157 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 158 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 159 | protected function _prep_query($sql) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 160 | { |
| 161 | return $sql; |
| 162 | } |
| 163 | |
| 164 | // -------------------------------------------------------------------- |
| 165 | |
| 166 | /** |
| 167 | * Begin Transaction |
| 168 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 169 | * @return bool |
| 170 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 171 | public function trans_begin($test_mode = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 172 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 173 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 174 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 175 | { |
| 176 | return TRUE; |
| 177 | } |
| 178 | |
| 179 | // Reset the transaction failure flag. |
| 180 | // If the $test_mode flag is set to TRUE transactions will be rolled back |
| 181 | // even if the queries produce a successful result. |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 182 | $this->_trans_failure = ($test_mode === TRUE); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 183 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 184 | return $this->simple_query('BEGIN TRAN'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | // -------------------------------------------------------------------- |
| 188 | |
| 189 | /** |
| 190 | * Commit Transaction |
| 191 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 192 | * @return bool |
| 193 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 194 | public function trans_commit() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 195 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 196 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 197 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 198 | { |
| 199 | return TRUE; |
| 200 | } |
| 201 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 202 | return $this->simple_query('COMMIT TRAN'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 203 | } |
| 204 | |
| 205 | // -------------------------------------------------------------------- |
| 206 | |
| 207 | /** |
| 208 | * Rollback Transaction |
| 209 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 210 | * @return bool |
| 211 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 212 | public function trans_rollback() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 213 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 214 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 215 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 216 | { |
| 217 | return TRUE; |
| 218 | } |
| 219 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 220 | return $this->simple_query('ROLLBACK TRAN'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 221 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 222 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 223 | // -------------------------------------------------------------------- |
| 224 | |
| 225 | /** |
| 226 | * Escape String |
| 227 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 228 | * @param string |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 229 | * @param bool whether or not the string will be used in a LIKE condition |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 230 | * @return string |
| 231 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 232 | public function escape_str($str, $like = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 233 | { |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 234 | if (is_array($str)) |
| 235 | { |
Pascal Kriete | c3a4a8d | 2011-02-14 13:40:08 -0500 | [diff] [blame] | 236 | foreach ($str as $key => $val) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 237 | { |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 238 | $str[$key] = $this->escape_str($val, $like); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | return $str; |
| 242 | } |
| 243 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 244 | // Escape single quotes |
Greg Aker | 757dda6 | 2010-04-14 19:06:19 -0500 | [diff] [blame] | 245 | $str = str_replace("'", "''", remove_invisible_characters($str)); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 246 | |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 247 | // escape LIKE condition wildcards |
| 248 | if ($like === TRUE) |
| 249 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 250 | return str_replace( |
Phil Sturgeon | 36b0c94 | 2011-04-02 12:16:41 +0100 | [diff] [blame] | 251 | array($this->_like_escape_chr, '%', '_'), |
| 252 | array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), |
| 253 | $str |
| 254 | ); |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 255 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 256 | |
Derek Jones | e4ed583 | 2009-02-20 21:44:59 +0000 | [diff] [blame] | 257 | return $str; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 258 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 259 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 260 | // -------------------------------------------------------------------- |
| 261 | |
| 262 | /** |
| 263 | * Affected Rows |
| 264 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 265 | * @return int |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 266 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 267 | public function affected_rows() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 268 | { |
| 269 | return @mssql_rows_affected($this->conn_id); |
| 270 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 271 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 272 | // -------------------------------------------------------------------- |
| 273 | |
| 274 | /** |
| 275 | * Insert ID |
| 276 | * |
| 277 | * Returns the last id created in the Identity column. |
| 278 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 279 | * @return int |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 280 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 281 | public function insert_id() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 282 | { |
Andrey Andreev | b7a47a7 | 2012-01-26 02:13:33 +0200 | [diff] [blame^] | 283 | $query = (self::_parse_major_version($this->version()) > 7) |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 284 | ? 'SELECT SCOPE_IDENTITY() AS last_id' |
| 285 | : 'SELECT @@IDENTITY AS last_id'; |
| 286 | |
Andrey Andreev | b7a47a7 | 2012-01-26 02:13:33 +0200 | [diff] [blame^] | 287 | $query = $this->query($query); |
| 288 | $query = $query->row(); |
| 289 | return $query->last_id; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 290 | } |
| 291 | |
| 292 | // -------------------------------------------------------------------- |
| 293 | |
| 294 | /** |
| 295 | * Parse major version |
| 296 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 297 | * Grabs the major version number from the |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 298 | * database server version string passed in. |
| 299 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 300 | * @param string $version |
| 301 | * @return int major version number |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 302 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 303 | private function _parse_major_version($version) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 304 | { |
| 305 | preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); |
| 306 | return $ver_info[1]; // return the major version b/c that's all we're interested in. |
| 307 | } |
| 308 | |
| 309 | // -------------------------------------------------------------------- |
| 310 | |
| 311 | /** |
| 312 | * Version number query string |
| 313 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 314 | * @return string |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 315 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 316 | protected function _version() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 317 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 318 | return 'SELECT @@VERSION AS ver'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | // -------------------------------------------------------------------- |
| 322 | |
| 323 | /** |
| 324 | * "Count All" query |
| 325 | * |
| 326 | * Generates a platform-specific query string that counts all records in |
| 327 | * the specified database |
| 328 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 329 | * @param string |
| 330 | * @return string |
| 331 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 332 | public function count_all($table = '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 333 | { |
| 334 | if ($table == '') |
Derek Allard | e37ab38 | 2009-02-03 16:13:57 +0000 | [diff] [blame] | 335 | { |
| 336 | return 0; |
| 337 | } |
| 338 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 339 | $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows').' FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 340 | if ($query->num_rows() == 0) |
Derek Allard | e37ab38 | 2009-02-03 16:13:57 +0000 | [diff] [blame] | 341 | { |
| 342 | return 0; |
| 343 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 344 | |
| 345 | $row = $query->row(); |
Greg Aker | 90248ab | 2011-08-20 14:23:14 -0500 | [diff] [blame] | 346 | $this->_reset_select(); |
Derek Allard | e37ab38 | 2009-02-03 16:13:57 +0000 | [diff] [blame] | 347 | return (int) $row->numrows; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 348 | } |
| 349 | |
| 350 | // -------------------------------------------------------------------- |
| 351 | |
| 352 | /** |
| 353 | * List table query |
| 354 | * |
| 355 | * Generates a platform-specific query string so that the table names can be fetched |
| 356 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 357 | * @param bool |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 358 | * @return string |
| 359 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 360 | protected function _list_tables($prefix_limit = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 361 | { |
| 362 | $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 363 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 364 | // for future compatibility |
| 365 | if ($prefix_limit !== FALSE AND $this->dbprefix != '') |
| 366 | { |
Greg Aker | 0d42489 | 2010-01-26 02:14:44 +0000 | [diff] [blame] | 367 | //$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 368 | return FALSE; // not currently supported |
| 369 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 370 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 371 | return $sql; |
| 372 | } |
| 373 | |
| 374 | // -------------------------------------------------------------------- |
| 375 | |
| 376 | /** |
| 377 | * List column query |
| 378 | * |
| 379 | * Generates a platform-specific query string so that the column names can be fetched |
| 380 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 381 | * @param string the table name |
| 382 | * @return string |
| 383 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 384 | protected function _list_columns($table = '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 385 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 386 | return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | // -------------------------------------------------------------------- |
| 390 | |
| 391 | /** |
| 392 | * Field data query |
| 393 | * |
| 394 | * Generates a platform-specific query so that the column data can be retrieved |
| 395 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 396 | * @param string the table name |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 397 | * @return string |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 398 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 399 | protected function _field_data($table) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 400 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 401 | return 'SELECT TOP 1 * FROM '.$table; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 402 | } |
| 403 | |
| 404 | // -------------------------------------------------------------------- |
| 405 | |
| 406 | /** |
| 407 | * The error message string |
| 408 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 409 | * @return string |
| 410 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 411 | protected function _error_message() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 412 | { |
Derek Allard | 64c398b | 2009-08-17 15:13:45 +0000 | [diff] [blame] | 413 | return mssql_get_last_message(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 414 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 415 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 416 | // -------------------------------------------------------------------- |
| 417 | |
| 418 | /** |
| 419 | * The error message number |
| 420 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 421 | * @return string |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 422 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 423 | protected function _error_number() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 424 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 425 | // Not supported in MSSQL |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 426 | return ''; |
| 427 | } |
| 428 | |
| 429 | // -------------------------------------------------------------------- |
| 430 | |
| 431 | /** |
| 432 | * Escape the SQL Identifiers |
| 433 | * |
| 434 | * This function escapes column and table names |
| 435 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 436 | * @param string |
| 437 | * @return string |
| 438 | */ |
Andrey Andreev | 3318ab8 | 2012-01-26 01:59:08 +0200 | [diff] [blame] | 439 | public function _escape_identifiers($item) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 440 | { |
| 441 | if ($this->_escape_char == '') |
| 442 | { |
| 443 | return $item; |
| 444 | } |
| 445 | |
| 446 | foreach ($this->_reserved_identifiers as $id) |
| 447 | { |
| 448 | if (strpos($item, '.'.$id) !== FALSE) |
| 449 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 450 | $item = str_replace('.', $this->_escape_char.'.', $item); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 451 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 452 | // remove duplicates if the user already included the escape |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 453 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 454 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | if (strpos($item, '.') !== FALSE) |
| 458 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 459 | $item = str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 460 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 461 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 462 | // remove duplicates if the user already included the escape |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 463 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item.$this->_escape_char); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 464 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 465 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 466 | // -------------------------------------------------------------------- |
| 467 | |
| 468 | /** |
| 469 | * From Tables |
| 470 | * |
| 471 | * This function implicitly groups FROM tables so there is no confusion |
| 472 | * about operator precedence in harmony with SQL standards |
| 473 | * |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 474 | * @param array |
| 475 | * @return string |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 476 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 477 | protected function _from_tables($tables) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 478 | { |
| 479 | if ( ! is_array($tables)) |
| 480 | { |
| 481 | $tables = array($tables); |
| 482 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 483 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 484 | return implode(', ', $tables); |
| 485 | } |
| 486 | |
| 487 | // -------------------------------------------------------------------- |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 488 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 489 | /** |
| 490 | * Insert statement |
| 491 | * |
| 492 | * Generates a platform-specific insert string from the supplied data |
| 493 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 494 | * @param string the table name |
| 495 | * @param array the insert keys |
| 496 | * @param array the insert values |
| 497 | * @return string |
| 498 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 499 | protected function _insert($table, $keys, $values) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 500 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 501 | return 'INSERT INTO '.$table.' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 502 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 503 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 504 | // -------------------------------------------------------------------- |
| 505 | |
| 506 | /** |
| 507 | * Update statement |
| 508 | * |
| 509 | * Generates a platform-specific update string from the supplied data |
| 510 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 511 | * @param string the table name |
| 512 | * @param array the update data |
| 513 | * @param array the where clause |
| 514 | * @param array the orderby clause |
| 515 | * @param array the limit clause |
| 516 | * @return string |
| 517 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 518 | protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 519 | { |
Pascal Kriete | c3a4a8d | 2011-02-14 13:40:08 -0500 | [diff] [blame] | 520 | foreach ($values as $key => $val) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 521 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 522 | $valstr[] = $key.' = '.$val; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 523 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 524 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 525 | return 'UPDATE '.$table.' SET '.implode(', ', $valstr) |
| 526 | .(($where != '' && count($where) > 0) ? ' WHERE '.implode(' ', $where) : '') |
| 527 | .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : '') |
| 528 | .( ! $limit ? '' : ' LIMIT '.$limit); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 529 | } |
| 530 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 531 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 532 | // -------------------------------------------------------------------- |
| 533 | |
| 534 | /** |
| 535 | * Truncate statement |
| 536 | * |
| 537 | * Generates a platform-specific truncate string from the supplied data |
| 538 | * If the database does not support the truncate() command |
| 539 | * This function maps to "DELETE FROM table" |
| 540 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 541 | * @param string the table name |
| 542 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 543 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 544 | protected function _truncate($table) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 545 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 546 | return 'TRUNCATE '.$table; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 547 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 548 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 549 | // -------------------------------------------------------------------- |
| 550 | |
| 551 | /** |
| 552 | * Delete statement |
| 553 | * |
| 554 | * Generates a platform-specific delete string from the supplied data |
| 555 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 556 | * @param string the table name |
| 557 | * @param array the where clause |
| 558 | * @param string the limit clause |
| 559 | * @return string |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 560 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 561 | protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 562 | { |
| 563 | $conditions = ''; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 564 | if (count($where) > 0 OR count($like) > 0) |
| 565 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 566 | $conditions .= "\nWHERE ".implode("\n", $this->ar_where); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 567 | |
| 568 | if (count($where) > 0 && count($like) > 0) |
| 569 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 570 | $conditions .= ' AND '; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 571 | } |
| 572 | $conditions .= implode("\n", $like); |
| 573 | } |
| 574 | |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 575 | return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | // -------------------------------------------------------------------- |
| 579 | |
| 580 | /** |
| 581 | * Limit string |
| 582 | * |
| 583 | * Generates a platform-specific LIMIT clause |
| 584 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 585 | * @param string the sql query string |
| 586 | * @param integer the number of rows to limit the query to |
| 587 | * @param integer the offset value |
| 588 | * @return string |
| 589 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 590 | protected function _limit($sql, $limit, $offset) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 591 | { |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 592 | return preg_replace('/(^\SELECT (DISTINCT)?)/i','\\1 TOP '.($limit + $offset).' ', $sql); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | // -------------------------------------------------------------------- |
| 596 | |
| 597 | /** |
| 598 | * Close DB Connection |
| 599 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 600 | * @param resource |
| 601 | * @return void |
| 602 | */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 603 | protected function _close($conn_id) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 604 | { |
| 605 | @mssql_close($conn_id); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 606 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 607 | |
| 608 | } |
| 609 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 610 | /* End of file mssql_driver.php */ |
Andrey Andreev | 4da24f8 | 2012-01-25 21:54:23 +0200 | [diff] [blame] | 611 | /* Location: ./system/database/drivers/mssql/mssql_driver.php */ |