Changeset 5678


Ignore:
Timestamp:
2006/09/25 12:00:24 (20 years ago)
Author:
kakinaka
Message:

blank

File:
1 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/html/admin/system/bkup.php

    r5677 r5678  
    145145         
    146146        if ($val != "dtb_bkup") { 
    147             // ¥Æ¡¼¥Ö¥ë¹½À®¤ò¼èÆÀ 
    148             $arrAutoInc = lfGetAutoIncrement($val); 
    149147             
    150             sfprintr($arrAutoInc); 
     148            // ¼«Æ°ºÎÈÖ·¿¤Î¹½À®¤ò¼èÆÀ¤¹¤ë 
     149            $csv_autoinc = lfGetAutoIncrement($val); 
     150             
     151            //sfprintr($csv_autoinc); 
    151152             
    152153            // Á´¥Ç¡¼¥¿¤ò¼èÆÀ 
     
    246247} 
    247248 
    248 // ¼«Æ°ºÎÈÖ·¿Ãͤò¼èÆÀ¤¹¤ë 
     249// ¼«Æ°ºÎÈÖ·¿¤òCSV½ÐÎÏ·Á¼°¤ËÊÑ´¹¤¹¤ë 
    249250function lfGetAutoIncrement($table_name){ 
     251    $arrColList = lfGetColumnList($table_name); 
     252     
     253    sfprintr($arrColList); 
     254     
     255} 
     256 
     257// ¥Æ¡¼¥Ö¥ë¹½À®¤ò¼èÆÀ¤¹¤ë 
     258function lfGetColumnList($table_name){ 
     259    $objQuery = new SC_Query(); 
     260 
     261    if(DB_TYPE == "pgsql"){ 
     262        $sql = "SELECT  
     263                    a.attname, t.typname, a.attnotnull, d.adsrc as defval, a.atttypmod, a.attnum as fldnum, e.description  
     264                FROM  
     265                    pg_class c, 
     266                    pg_type t, 
     267                    pg_attribute a left join pg_attrdef d on (a.attrelid=d.adrelid and a.attnum=d.adnum) 
     268                                   left join pg_description e on (a.attrelid=e.objoid and a.attnum=e.objsubid) 
     269                WHERE (c.relname=?) AND (c.oid=a.attrelid) AND (a.atttypid=t.oid) AND a.attnum > 0 
     270                ORDER BY fldnum"; 
     271        $arrRet = $objQuery->getAll($sql, array($table_name)); 
     272    } 
     273     
     274    return sfSwapArray($arrRet); 
     275} 
     276 
     277// ¼«Æ°ºÎÈÖ·¿¤ÎÃͤò¼èÆÀ¤¹¤ë 
     278function lfGetAutoIncrementVal($table_name){ 
    250279    $objQuery = new SC_Query(); 
    251280 
     
    265294        $arrRet = $objQuery->getAll($sql, array($table_name)); 
    266295    } 
    267      
    268296    return $arrRet; 
    269  
    270297} 
    271298 
Note: See TracChangeset for help on using the changeset viewer.