Changeset 9412
- Timestamp:
- 2006/11/29 18:05:32 (20 years ago)
- Location:
- temp/trunk
- Files:
-
- 2 edited
-
data/lib/slib.php (modified) (4 diffs)
-
html/admin/products/product.php (modified) (1 diff)
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 -
temp/trunk/html/admin/products/product.php
r9410 r9412 346 346 $sqlval['product_id'] = $product_id; 347 347 } 348 349 // dtb_products_class ¤Î¥«¥é¥à¤ò¼èÆÀ 350 351 352 // ¥³¥Ô¡¼¾¦Éʤξì¹ç¤Ë¤Ïµ¬³Ê¤â¥³¥Ô¡¼¤¹¤ë 353 "INSERT INTO dtb_pSELECT * FROM dtb_products_class WHERE product_id = ? ORDER BY product_class_id"; 354 348 355 349 356 } else {
Note: See TracChangeset
for help on using the changeset viewer.
