  |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
7 | 7 | | |
  |
8 | | - | Copyright (c) 2006 osCommerce |
| |
| 8 | + | Copyright (c) 2007 osCommerce |
|
9 | 9 | | |
| |
10 | 10 | | Released under the GNU General Public License |
| |
11 | 11 | | */ |
| |
|
|
 |
… |
|
138 | 138 | | } |
| |
139 | 139 | | |
| |
140 | 140 | | function nextID() { |
  |
141 | | - | if ($id = @mysqli_insert_id($this->link)) { |
| |
| 141 | + | if ( is_numeric($this->nextID) ) { |
| |
| 142 | + | $id = $this->nextID; |
| |
| 143 | + | $this->nextID = null; |
| |
| 144 | + | |
|
142 | 145 | | return $id; |
  |
| 146 | + | } elseif ($id = @mysqli_insert_id($this->link)) { |
| |
| 147 | + | return $id; |
|
143 | 148 | | } else { |
| |
144 | 149 | | $this->setError(mysqli_error($this->link), mysqli_errno($this->link)); |
| |
145 | 150 | | |
| |
|
|
 |
… |
|
155 | 160 | | return @mysqli_affected_rows($this->link); |
| |
156 | 161 | | } |
| |
157 | 162 | | |
  |
158 | | - | function startTransaction() { |
| |
| 163 | + | function startTransaction($logging = false) { |
| |
| 164 | + | if ($logging === true) { |
| |
| 165 | + | $this->logging_transaction = true; |
| |
| 166 | + | } |
| |
| 167 | + | |
|
159 | 168 | | if ($this->use_transactions === true) { |
| |
160 | 169 | | return @mysqli_autocommit($this->link, false); |
| |
161 | 170 | | } |
| |
|
|
 |
… |
|
164 | 173 | | } |
| |
165 | 174 | | |
| |
166 | 175 | | function commitTransaction() { |
  |
| 176 | + | if ($this->logging_transaction === true) { |
| |
| 177 | + | $this->logging_transaction = false; |
| |
| 178 | + | $this->logging_transaction_action = false; |
| |
| 179 | + | } |
| |
| 180 | + | |
|
167 | 181 | | if ($this->use_transactions === true) { |
| |
168 | 182 | | $result = @mysqli_commit($this->link); |
| |
169 | 183 | | |
| |
|
|
 |
… |
|
176 | 190 | | } |
| |
177 | 191 | | |
| |
178 | 192 | | function rollbackTransaction() { |
  |
| 193 | + | if ($this->logging_transaction === true) { |
| |
| 194 | + | $this->logging_transaction = false; |
| |
| 195 | + | $this->logging_transaction_action = false; |
| |
| 196 | + | } |
| |
| 197 | + | |
  |
179 | 198 | | if ($this->use_transactions === true) { |
| |
180 | 199 | | $result = @mysqli_rollback($this->link); |
| |
181 | 200 | | |