Changeset 9412 for temp/trunk/data/lib
- Timestamp:
- 2006/11/29 18:05:32 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/data/lib/slib.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/lib/slib.php
r9325 r9412 99 99 // Àµ¾ï¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 100 100 if(!$objQuery->isError()) { 101 $arrRet = sfGetColumnList($table_name, $objQuery); 102 if(count($arrRet) > 0) { 103 if(!in_array($col_name, $arrRet)){ 104 return true; 105 } 106 } 107 108 /* 101 109 list($db_type) = split(":", $dsn); 102 110 // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë … … 118 126 } 119 127 }else if ($db_type == "mysql") { 120 $sql = "SHOW COLUMNS FROM $table_name"; 121 $arrRet = $objQuery->getAll($sql); 128 $arrRet = sfGetColumnList($table_name, $objQuery); 122 129 if(count($arrRet) > 0) { 123 130 if(!in_array($col_name, $arrRet)){ … … 126 133 } 127 134 } 135 */ 128 136 } 129 137 … … 135 143 136 144 return false; 145 } 146 147 // ¥Æ¡¼¥Ö¥ë¤Î¥«¥é¥à°ìÍ÷¤ò¼èÆÀ¤¹¤ë 148 function sfGetColumnList($table_name, $objQuery = ""){ 149 if($objQuery == "") $objQuery = new SC_Query(); 150 $arrRet = array(); 151 152 // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë 153 if (DB_TYPE == "pgsql") { 154 $sql = "SELECT a.attname FROM pg_class c, pg_attribute a WHERE c.relname=? AND c.oid=a.attrelid AND a.attnum > 0 ORDER BY a.attnum"; 155 $arrRet = $objQuery->getAll($sql, array($table_name)); 156 }else if (DB_TYPE == "mysql") { 157 $sql = "SHOW COLUMNS FROM $table_name"; 158 $arrRet = $objQuery->getAll($sql); 159 } 160 161 return $arrRet; 137 162 } 138 163
Note: See TracChangeset
for help on using the changeset viewer.
