  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: mysql.php 1319 2007-03-05 20:43:07Z hpdl $ |
| |
| 3 | + | $Id: mysql.php 1372 2007-03-05 22:58:51Z hpdl $ |
|
4 | 4 | | |
| |
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 | | */ |
| |
|
|
 |
… |
|
183 | 183 | | } |
| |
184 | 184 | | |
| |
185 | 185 | | function nextID() { |
  |
186 | | - | if ($id = @mysql_insert_id($this->link)) { |
| |
| 186 | + | if ( is_numeric($this->nextID) ) { |
| |
| 187 | + | $id = $this->nextID; |
| |
| 188 | + | $this->nextID = null; |
| |
| 189 | + | |
|
187 | 190 | | return $id; |
  |
| 191 | + | } elseif ($id = @mysql_insert_id($this->link)) { |
| |
| 192 | + | return $id; |
|
188 | 193 | | } else { |
| |
189 | 194 | | $this->setError(mysql_error($this->link), mysql_errno($this->link)); |
| |
190 | 195 | | |
| |
|
|
 |
… |
|
201 | 206 | | } |
| |
202 | 207 | | |
| |
203 | 208 | | function startTransaction() { |
  |
| 209 | + | $this->logging_transaction = true; |
| |
| 210 | + | |
|
204 | 211 | | if ($this->use_transactions === true) { |
| |
205 | 212 | | return $this->simpleQuery('start transaction'); |
| |
206 | 213 | | } |
| |
|
|
 |
… |
|
209 | 216 | | } |
| |
210 | 217 | | |
| |
211 | 218 | | function commitTransaction() { |
  |
| 219 | + | if ($this->logging_transaction === true) { |
| |
| 220 | + | $this->logging_transaction = false; |
| |
| 221 | + | $this->logging_transaction_action = false; |
| |
| 222 | + | } |
| |
| 223 | + | |
|
212 | 224 | | if ($this->use_transactions === true) { |
| |
213 | 225 | | return $this->simpleQuery('commit'); |
| |
214 | 226 | | } |
| |
|
|
 |
… |
|
217 | 229 | | } |
| |
218 | 230 | | |
| |
219 | 231 | | function rollbackTransaction() { |
  |
| 232 | + | if ($this->logging_transaction === true) { |
| |
| 233 | + | $this->logging_transaction = false; |
| |
| 234 | + | $this->logging_transaction_action = false; |
| |
| 235 | + | } |
| |
| 236 | + | |
  |
220 | 237 | | if ($this->use_transactions === true) { |
| |
221 | 238 | | return $this->simpleQuery('rollback'); |
| |
222 | 239 | | } |