Changeset 14921 for branches/rel/data


Ignore:
Timestamp:
2007/06/26 12:04:18 (17 years ago)
Author:
uehara
Message:

商品登録CSV改修
MySQLのauto_incrementバグに対応

Location:
branches/rel/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/rel/data/class/SC_Query.php

    r12157 r14921  
    419419    } 
    420420     
    421     // auto_increment¤ò¼èÆÀ¤¹¤ë 
    422     function get_auto_increment($table_name){ 
    423         // ¥í¥Ã¥¯¤¹¤ë 
    424         $this->BEGIN(); 
    425          
    426         // ¼¡¤ÎIncrement¤ò¼èÆÀ 
    427         $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name)); 
    428         $auto_inc_no = $arrRet[0]["Auto_increment"]; 
    429          
    430         // Ãͤò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯ 
    431         $this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1); 
    432          
    433         // ²ò½ü¤¹¤ë 
    434         $this->COMMIT(); 
    435          
    436         return $auto_inc_no; 
    437     } 
     421    // auto_increment¤ò¼èÆÀ¤¹¤ë 
     422    function get_auto_increment($table_name){ 
     423        // ¥í¥Ã¥¯¤¹¤ë 
     424        $this->query("LOCK TABLES $table_name WRITE"); 
     425         
     426        // ¼¡¤ÎIncrement¤ò¼èÆÀ 
     427        $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name)); 
     428        $auto_inc_no = $arrRet[0]["Auto_increment"]; 
     429         
     430        // Ãͤò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯ 
     431        $this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1); 
     432         
     433        // ²ò½ü¤¹¤ë 
     434        $this->query('UNLOCK TABLES'); 
     435         
     436        return $auto_inc_no; 
     437    } 
    438438} 
    439439 
  • branches/rel/data/conf/conf.php

    r14900 r14921  
    172172define("DEFAULT_PASSWORD", "UAhgGR3L"); 
    173173//¤ª¤¹¤¹¤á¾¦ÉÊ¿ô 
    174 define ("RECOMMEND_PRODUCT_MAX", 5); 
     174define ("RECOMMEND_PRODUCT_MAX", 6); 
    175175 
    176176//Ê̤ΤªÆϤ±ÀèºÇÂçÅÐÏ¿¿ô 
Note: See TracChangeset for help on using the changeset viewer.