- Timestamp:
- 2007/06/26 11:38:27 (19 years ago)
- File:
-
- 1 edited
-
branches/dev/data/class/SC_Query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/dev/data/class/SC_Query.php
r14591 r14918 590 590 } 591 591 592 // auto_increment¤ò¼èÆÀ¤¹¤ë593 function get_auto_increment($table_name){594 // ¥í¥Ã¥¯¤¹¤ë595 $this->BEGIN();596 597 // ¼¡¤ÎIncrement¤ò¼èÆÀ598 $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name));599 $auto_inc_no = $arrRet[0]["Auto_increment"];600 601 // Ãͤò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯602 $this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1);603 604 // ²ò½ü¤¹¤ë605 $this->COMMIT();606 607 return $auto_inc_no;608 }592 // auto_increment¤ò¼èÆÀ¤¹¤ë 593 function get_auto_increment($table_name){ 594 // ¥í¥Ã¥¯¤¹¤ë 595 $this->query("LOCK TABLES $table_name WRITE"); 596 597 // ¼¡¤ÎIncrement¤ò¼èÆÀ 598 $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name)); 599 $auto_inc_no = $arrRet[0]["Auto_increment"]; 600 601 // Ãͤò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯ 602 $this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1); 603 604 // ²ò½ü¤¹¤ë 605 $this->query('UNLOCK TABLES'); 606 607 return $auto_inc_no; 608 } 609 609 } 610 610 ?>
Note: See TracChangeset
for help on using the changeset viewer.
