Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 5.1.6 or newer |
| 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +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 | 7f55d61 | 2012-01-26 13:44:28 +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 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [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) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 2.0.2 |
| 25 | * @filesource |
| 26 | */ |
| 27 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 28 | /** |
| 29 | * CUBRID 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 |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 38 | * @author Esen Sagynov |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 39 | * @link http://codeigniter.com/user_guide/database/ |
| 40 | */ |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 41 | class CI_DB_cubrid_driver extends CI_DB { |
| 42 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 43 | public $dbdriver = 'cubrid'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 44 | |
| 45 | // The character used for escaping - no need in CUBRID |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 46 | protected $_escape_char = ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 47 | |
| 48 | // clause and character used for LIKE escape sequences - not used in CUBRID |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 49 | protected $_like_escape_str = ''; |
| 50 | protected $_like_escape_chr = ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * The syntax to count rows is slightly different across different |
| 54 | * database engines, so this string appears in each driver and is |
| 55 | * used for the count_all() and count_all_results() functions. |
| 56 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 57 | protected $_count_string = 'SELECT COUNT(*) AS '; |
| 58 | protected $_random_keyword = ' RAND()'; // database specific random keyword |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 59 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 60 | public function __construct() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 61 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 62 | // If no port is defined by the user, use the default value |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 63 | if ($this->port == '') |
| 64 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 65 | // Default CUBRID broker port |
| 66 | $this->port = 33000; |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 67 | } |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 68 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 69 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 70 | /** |
| 71 | * Non-persistent database connection |
| 72 | * |
| 73 | * @return resource |
| 74 | */ |
| 75 | public function db_connect() |
| 76 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 77 | $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 78 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 79 | if ($conn) |
| 80 | { |
| 81 | // Check if a user wants to run queries in dry, i.e. run the |
| 82 | // queries but not commit them. |
| 83 | if (isset($this->auto_commit) && ! $this->auto_commit) |
| 84 | { |
| 85 | cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE); |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE); |
| 90 | $this->auto_commit = TRUE; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | return $conn; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | // -------------------------------------------------------------------- |
| 98 | |
| 99 | /** |
| 100 | * Persistent database connection |
| 101 | * In CUBRID persistent DB connection is supported natively in CUBRID |
| 102 | * engine which can be configured in the CUBRID Broker configuration |
| 103 | * file by setting the CCI_PCONNECT parameter to ON. In that case, all |
| 104 | * connections established between the client application and the |
| 105 | * server will become persistent. This is calling the same |
| 106 | * @cubrid_connect function will establish persisten connection |
| 107 | * considering that the CCI_PCONNECT is ON. |
| 108 | * |
| 109 | * @access private called by the base class |
| 110 | * @return resource |
| 111 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 112 | public function db_pconnect() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 113 | { |
| 114 | return $this->db_connect(); |
| 115 | } |
| 116 | |
| 117 | // -------------------------------------------------------------------- |
| 118 | |
| 119 | /** |
| 120 | * Reconnect |
| 121 | * |
| 122 | * Keep / reestablish the db connection if no queries have been |
| 123 | * sent for a length of time exceeding the server's idle timeout |
| 124 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 125 | * @return void |
| 126 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 127 | public function reconnect() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 128 | { |
| 129 | if (cubrid_ping($this->conn_id) === FALSE) |
| 130 | { |
| 131 | $this->conn_id = FALSE; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | // -------------------------------------------------------------------- |
| 136 | |
| 137 | /** |
| 138 | * Select the database |
| 139 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 140 | * @return resource |
| 141 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 142 | public function db_select() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 143 | { |
| 144 | // In CUBRID there is no need to select a database as the database |
| 145 | // is chosen at the connection time. |
| 146 | // So, to determine if the database is "selected", all we have to |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 147 | // do is ping the server and return that value. |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 148 | return cubrid_ping($this->conn_id); |
| 149 | } |
| 150 | |
| 151 | // -------------------------------------------------------------------- |
| 152 | |
| 153 | /** |
| 154 | * Set client character set |
| 155 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 156 | * @param string |
| 157 | * @param string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 158 | * @return bool |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 159 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 160 | public function db_set_charset($charset, $collation) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 161 | { |
| 162 | // In CUBRID, there is no need to set charset or collation. |
| 163 | // This is why returning true will allow the application continue |
| 164 | // its normal process. |
| 165 | return TRUE; |
| 166 | } |
| 167 | |
| 168 | // -------------------------------------------------------------------- |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 169 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 170 | /** |
| 171 | * Version number query string |
| 172 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 173 | * @return string |
| 174 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 175 | protected function _version() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 176 | { |
| 177 | return cubrid_get_server_info($this->conn_id); |
| 178 | } |
| 179 | |
| 180 | // -------------------------------------------------------------------- |
| 181 | |
| 182 | /** |
| 183 | * Execute the query |
| 184 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 185 | * @param string an SQL query |
| 186 | * @return resource |
| 187 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 188 | protected function _execute($sql) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 189 | { |
| 190 | $sql = $this->_prep_query($sql); |
| 191 | return @cubrid_query($sql, $this->conn_id); |
| 192 | } |
| 193 | |
| 194 | // -------------------------------------------------------------------- |
| 195 | |
| 196 | /** |
| 197 | * Prep the query |
| 198 | * |
| 199 | * If needed, each database adapter can prep the query string |
| 200 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 201 | * @param string an SQL query |
| 202 | * @return string |
| 203 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 204 | protected function _prep_query($sql) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 205 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 206 | // No need to prepare |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 207 | return $sql; |
| 208 | } |
| 209 | |
| 210 | // -------------------------------------------------------------------- |
| 211 | |
| 212 | /** |
| 213 | * Begin Transaction |
| 214 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 215 | * @return bool |
| 216 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 217 | public function trans_begin($test_mode = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 218 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 219 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 220 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 221 | { |
| 222 | return TRUE; |
| 223 | } |
| 224 | |
| 225 | // Reset the transaction failure flag. |
| 226 | // If the $test_mode flag is set to TRUE transactions will be rolled back |
| 227 | // even if the queries produce a successful result. |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 228 | $this->_trans_failure = ($test_mode === TRUE); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 229 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 230 | if (cubrid_get_autocommit($this->conn_id)) |
| 231 | { |
| 232 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_FALSE); |
| 233 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 234 | |
| 235 | return TRUE; |
| 236 | } |
| 237 | |
| 238 | // -------------------------------------------------------------------- |
| 239 | |
| 240 | /** |
| 241 | * Commit Transaction |
| 242 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 243 | * @return bool |
| 244 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 245 | public function trans_commit() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 246 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 247 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 248 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 249 | { |
| 250 | return TRUE; |
| 251 | } |
| 252 | |
| 253 | cubrid_commit($this->conn_id); |
| 254 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 255 | if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) |
| 256 | { |
| 257 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); |
| 258 | } |
| 259 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 260 | return TRUE; |
| 261 | } |
| 262 | |
| 263 | // -------------------------------------------------------------------- |
| 264 | |
| 265 | /** |
| 266 | * Rollback Transaction |
| 267 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 268 | * @return bool |
| 269 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 270 | public function trans_rollback() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 271 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 272 | // When transactions are nested we only begin/commit/rollback the outermost ones |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 273 | if ( ! $this->trans_enabled OR $this->_trans_depth > 0) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 274 | { |
| 275 | return TRUE; |
| 276 | } |
| 277 | |
| 278 | cubrid_rollback($this->conn_id); |
| 279 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 280 | if ($this->auto_commit && ! cubrid_get_autocommit($this->conn_id)) |
| 281 | { |
| 282 | cubrid_set_autocommit($this->conn_id, CUBRID_AUTOCOMMIT_TRUE); |
| 283 | } |
| 284 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 285 | return TRUE; |
| 286 | } |
| 287 | |
| 288 | // -------------------------------------------------------------------- |
| 289 | |
| 290 | /** |
| 291 | * Escape String |
| 292 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 293 | * @param string |
| 294 | * @param bool whether or not the string will be used in a LIKE condition |
| 295 | * @return string |
| 296 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 297 | public function escape_str($str, $like = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 298 | { |
| 299 | if (is_array($str)) |
| 300 | { |
| 301 | foreach ($str as $key => $val) |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 302 | { |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 303 | $str[$key] = $this->escape_str($val, $like); |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 304 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 305 | |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 306 | return $str; |
| 307 | } |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 308 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 309 | if (function_exists('cubrid_real_escape_string') && is_resource($this->conn_id)) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 310 | { |
| 311 | $str = cubrid_real_escape_string($str, $this->conn_id); |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | $str = addslashes($str); |
| 316 | } |
| 317 | |
| 318 | // escape LIKE condition wildcards |
| 319 | if ($like === TRUE) |
| 320 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 321 | return str_replace(array('%', '_'), array('\\%', '\\_'), $str); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 322 | } |
| 323 | |
| 324 | return $str; |
| 325 | } |
| 326 | |
| 327 | // -------------------------------------------------------------------- |
| 328 | |
| 329 | /** |
| 330 | * Affected Rows |
| 331 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 332 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 333 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 334 | public function affected_rows() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 335 | { |
| 336 | return @cubrid_affected_rows($this->conn_id); |
| 337 | } |
| 338 | |
| 339 | // -------------------------------------------------------------------- |
| 340 | |
| 341 | /** |
| 342 | * Insert ID |
| 343 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 344 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 345 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 346 | public function insert_id() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 347 | { |
| 348 | return @cubrid_insert_id($this->conn_id); |
| 349 | } |
| 350 | |
| 351 | // -------------------------------------------------------------------- |
| 352 | |
| 353 | /** |
| 354 | * "Count All" query |
| 355 | * |
| 356 | * Generates a platform-specific query string that counts all records in |
| 357 | * the specified table |
| 358 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 359 | * @param string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 360 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 361 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 362 | public function count_all($table = '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 363 | { |
| 364 | if ($table == '') |
| 365 | { |
| 366 | return 0; |
| 367 | } |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 368 | $query = $this->query($this->_count_string.$this->_protect_identifiers('numrows').' FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE)); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 369 | if ($query->num_rows() == 0) |
| 370 | { |
| 371 | return 0; |
| 372 | } |
| 373 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 374 | $query = $query->row(); |
Greg Aker | 90248ab | 2011-08-20 14:23:14 -0500 | [diff] [blame] | 375 | $this->_reset_select(); |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 376 | return (int) $query->numrows; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | // -------------------------------------------------------------------- |
| 380 | |
| 381 | /** |
| 382 | * List table query |
| 383 | * |
| 384 | * Generates a platform-specific query string so that the table names can be fetched |
| 385 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 386 | * @param boolean |
| 387 | * @return string |
| 388 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 389 | protected function _list_tables($prefix_limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 390 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 391 | $sql = 'SHOW TABLES'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 392 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 393 | if ($prefix_limit !== FALSE && $this->dbprefix != '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 394 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 395 | return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | return $sql; |
| 399 | } |
| 400 | |
| 401 | // -------------------------------------------------------------------- |
| 402 | |
| 403 | /** |
| 404 | * Show column query |
| 405 | * |
| 406 | * Generates a platform-specific query string so that the column names can be fetched |
| 407 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 408 | * @param string the table name |
| 409 | * @return string |
| 410 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 411 | protected function _list_columns($table = '') |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 412 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 413 | return 'SHOW COLUMNS FROM '.$this->_protect_identifiers($table, TRUE, NULL, FALSE); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 414 | } |
| 415 | |
| 416 | // -------------------------------------------------------------------- |
| 417 | |
| 418 | /** |
| 419 | * Field data query |
| 420 | * |
| 421 | * Generates a platform-specific query so that the column data can be retrieved |
| 422 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 423 | * @param string the table name |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 424 | * @return string |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 425 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 426 | protected function _field_data($table) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 427 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 428 | return 'SELECT * FROM '.$table.' LIMIT 1'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | // -------------------------------------------------------------------- |
| 432 | |
| 433 | /** |
| 434 | * The error message string |
| 435 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 436 | * @return string |
| 437 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 438 | protected function _error_message() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 439 | { |
| 440 | return cubrid_error($this->conn_id); |
| 441 | } |
| 442 | |
| 443 | // -------------------------------------------------------------------- |
| 444 | |
| 445 | /** |
| 446 | * The error message number |
| 447 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 448 | * @return int |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 449 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 450 | protected function _error_number() |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 451 | { |
| 452 | return cubrid_errno($this->conn_id); |
| 453 | } |
| 454 | |
| 455 | // -------------------------------------------------------------------- |
| 456 | |
| 457 | /** |
| 458 | * Escape the SQL Identifiers |
| 459 | * |
| 460 | * This function escapes column and table names |
| 461 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 462 | * @param string |
| 463 | * @return string |
| 464 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 465 | public function _escape_identifiers($item) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 466 | { |
| 467 | if ($this->_escape_char == '') |
| 468 | { |
| 469 | return $item; |
| 470 | } |
| 471 | |
| 472 | foreach ($this->_reserved_identifiers as $id) |
| 473 | { |
| 474 | if (strpos($item, '.'.$id) !== FALSE) |
| 475 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 476 | $item = str_replace('.', $this->_escape_char.'.', $item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 477 | |
| 478 | // remove duplicates if the user already included the escape |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 479 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 480 | } |
| 481 | } |
| 482 | |
| 483 | if (strpos($item, '.') !== FALSE) |
| 484 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 485 | $item = str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 486 | } |
| 487 | |
| 488 | // remove duplicates if the user already included the escape |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 489 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $this->_escape_char.$item.$this->_escape_char); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 490 | } |
| 491 | |
| 492 | // -------------------------------------------------------------------- |
| 493 | |
| 494 | /** |
| 495 | * From Tables |
| 496 | * |
| 497 | * This function implicitly groups FROM tables so there is no confusion |
| 498 | * about operator precedence in harmony with SQL standards |
| 499 | * |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 500 | * @param string the table name |
| 501 | * @return string |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 502 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 503 | protected function _from_tables($tables) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 504 | { |
| 505 | if ( ! is_array($tables)) |
| 506 | { |
| 507 | $tables = array($tables); |
| 508 | } |
| 509 | |
| 510 | return '('.implode(', ', $tables).')'; |
| 511 | } |
| 512 | |
| 513 | // -------------------------------------------------------------------- |
| 514 | |
| 515 | /** |
| 516 | * Insert statement |
| 517 | * |
| 518 | * Generates a platform-specific insert string from the supplied data |
| 519 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 520 | * @param string the table name |
| 521 | * @param array the insert keys |
| 522 | * @param array the insert values |
| 523 | * @return string |
| 524 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 525 | protected function _insert($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 526 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 527 | return 'INSERT INTO '.$table.' ("'.implode('", "', $keys).'") VALUES ('.implode(', ', $values).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | // -------------------------------------------------------------------- |
| 531 | |
| 532 | |
| 533 | /** |
| 534 | * Replace statement |
| 535 | * |
| 536 | * Generates a platform-specific replace string from the supplied data |
| 537 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 538 | * @param string the table name |
| 539 | * @param array the insert keys |
| 540 | * @param array the insert values |
| 541 | * @return string |
| 542 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 543 | protected function _replace($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 544 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 545 | return 'REPLACE INTO '.$table.' ("'.implode('", "', $keys).'") VALUES ('.implode(', ', $values).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 546 | } |
| 547 | |
| 548 | // -------------------------------------------------------------------- |
| 549 | |
| 550 | /** |
| 551 | * Insert_batch statement |
| 552 | * |
| 553 | * Generates a platform-specific insert string from the supplied data |
| 554 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 555 | * @param string the table name |
| 556 | * @param array the insert keys |
| 557 | * @param array the insert values |
| 558 | * @return string |
| 559 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 560 | protected function _insert_batch($table, $keys, $values) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 561 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 562 | return 'INSERT INTO '.$table.' ("'.implode('", "', $keys).'") VALUES '.implode(', ', $values); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | // -------------------------------------------------------------------- |
| 566 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 567 | /** |
| 568 | * Update statement |
| 569 | * |
| 570 | * Generates a platform-specific update string from the supplied data |
| 571 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 572 | * @param string the table name |
| 573 | * @param array the update data |
| 574 | * @param array the where clause |
| 575 | * @param array the orderby clause |
| 576 | * @param array the limit clause |
| 577 | * @return string |
| 578 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 579 | protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 580 | { |
| 581 | foreach ($values as $key => $val) |
| 582 | { |
Esen Sagynov | ee3e594 | 2011-08-10 03:22:58 -0700 | [diff] [blame] | 583 | $valstr[] = sprintf('"%s" = %s', $key, $val); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 584 | } |
| 585 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 586 | return 'UPDATE '.$table.' SET '.implode(', ', $valstr) |
| 587 | .(($where != '' && count($where) > 0) ? ' WHERE '.implode(' ', $where) : '') |
| 588 | .(count($orderby) > 0 ? ' ORDER BY '.implode(', ', $orderby) : '') |
| 589 | .( ! $limit ? '' : ' LIMIT '.$limit); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 590 | } |
| 591 | |
| 592 | // -------------------------------------------------------------------- |
| 593 | |
| 594 | |
| 595 | /** |
| 596 | * Update_Batch statement |
| 597 | * |
| 598 | * Generates a platform-specific batch update string from the supplied data |
| 599 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 600 | * @param string the table name |
| 601 | * @param array the update data |
| 602 | * @param array the where clause |
| 603 | * @return string |
| 604 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 605 | protected function _update_batch($table, $values, $index, $where = NULL) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 606 | { |
| 607 | $ids = array(); |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 608 | $where = ($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : ''; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 609 | |
| 610 | foreach ($values as $key => $val) |
| 611 | { |
| 612 | $ids[] = $val[$index]; |
| 613 | |
| 614 | foreach (array_keys($val) as $field) |
| 615 | { |
| 616 | if ($field != $index) |
| 617 | { |
Esen Sagynov | 2ab2b1e | 2011-08-11 00:41:16 -0700 | [diff] [blame] | 618 | $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 619 | } |
| 620 | } |
| 621 | } |
| 622 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 623 | $sql = 'UPDATE '.$table.' SET '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 624 | $cases = ''; |
| 625 | |
| 626 | foreach ($final as $k => $v) |
| 627 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 628 | $cases .= $k." = CASE \n" |
| 629 | .implode("\n", $v) |
| 630 | .'ELSE '.$k.' END, '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 631 | } |
| 632 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 633 | return $sql.substr($cases, 0, -2) |
| 634 | .' WHERE '.(($where != '' && count($where) > 0) ? implode(' ', $where).' AND ' : '') |
| 635 | .$index.' IN ('.implode(',', $ids).')'; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | // -------------------------------------------------------------------- |
| 639 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 640 | /** |
| 641 | * Truncate statement |
| 642 | * |
| 643 | * Generates a platform-specific truncate string from the supplied data |
| 644 | * If the database does not support the truncate() command |
| 645 | * This function maps to "DELETE FROM table" |
| 646 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 647 | * @param string the table name |
| 648 | * @return string |
| 649 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 650 | protected function _truncate($table) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 651 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 652 | return 'TRUNCATE '.$table; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 653 | } |
| 654 | |
| 655 | // -------------------------------------------------------------------- |
| 656 | |
| 657 | /** |
| 658 | * Delete statement |
| 659 | * |
| 660 | * Generates a platform-specific delete string from the supplied data |
| 661 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 662 | * @param string the table name |
| 663 | * @param array the where clause |
| 664 | * @param string the limit clause |
| 665 | * @return string |
| 666 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 667 | protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 668 | { |
| 669 | $conditions = ''; |
| 670 | |
| 671 | if (count($where) > 0 OR count($like) > 0) |
| 672 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 673 | $conditions = "\nWHERE ".implode("\n", $this->ar_where); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 674 | |
| 675 | if (count($where) > 0 && count($like) > 0) |
| 676 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 677 | $conditions .= ' AND '; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 678 | } |
| 679 | $conditions .= implode("\n", $like); |
| 680 | } |
| 681 | |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 682 | return 'DELETE FROM '.$table.$conditions.( ! $limit ? '' : ' LIMIT '.$limit); |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 683 | } |
| 684 | |
| 685 | // -------------------------------------------------------------------- |
| 686 | |
| 687 | /** |
| 688 | * Limit string |
| 689 | * |
| 690 | * Generates a platform-specific LIMIT clause |
| 691 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 692 | * @param string the sql query string |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 693 | * @param int the number of rows to limit the query to |
| 694 | * @param int the offset value |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 695 | * @return string |
| 696 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 697 | protected function _limit($sql, $limit, $offset) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 698 | { |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 699 | return $sql.'LIMIT '.($offset == 0 ? '' : ', ').$limit; |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | // -------------------------------------------------------------------- |
| 703 | |
| 704 | /** |
| 705 | * Close DB Connection |
| 706 | * |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 707 | * @param resource |
| 708 | * @return void |
| 709 | */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 710 | protected function _close($conn_id) |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 711 | { |
| 712 | @cubrid_close($conn_id); |
| 713 | } |
| 714 | |
| 715 | } |
| 716 | |
Esen Sagynov | 2e08794 | 2011-08-09 23:35:01 -0700 | [diff] [blame] | 717 | /* End of file cubrid_driver.php */ |
Andrey Andreev | 7f55d61 | 2012-01-26 13:44:28 +0200 | [diff] [blame^] | 718 | /* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ |