Changeset 7424 for temp/trunk/data/lib
- Timestamp:
- 2006/11/06 09:54:45 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/data/lib/slib.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/lib/slib.php
r7180 r7424 69 69 relname"; 70 70 $arrRet = $objQuery->getAll($sql, array($table_name)); 71 if(count($arrRet) > 0) { 72 return true; 73 } 74 }else if ($db_type == "mysql") { 75 $sql = "SHOW TABLE STATUS LIKE ?"; 76 $arrRet = $objQuery->getAll($sql, array($table_name)); 77 if(count($arrRet) > 0) { 78 return true; 79 } 80 } 81 } 82 return false; 83 } 84 85 // ¥«¥é¥à¤Î¸ºß¥Á¥§¥Ã¥¯ 86 function sfColumnExists($table_name, $col_name, $dsn = "") { 87 if($dsn == "") { 88 if(defined('DEFAULT_DSN')) { 89 $dsn = DEFAULT_DSN; 90 } else { 91 return; 92 } 93 } 94 95 $objQuery = new SC_Query($dsn, true, true); 96 // Àµ¾ï¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 97 if(!$objQuery->isError()) { 98 list($db_type) = split(":", $dsn); 99 // postgresql¤Èmysql¤È¤Ç½èÍý¤òʬ¤±¤ë 100 if ($db_type == "pgsql") { 101 $sql = "SELECT 102 a.attname 103 FROM 104 pg_class c, pg_attribute a 105 WHERE 106 c.relname=? AND 107 a.attname=? AND 108 c.oid=a.attrelid AND 109 a.attnum > 0 110 ORDER BY 111 a.attnum"; 112 $arrRet = $objQuery->getAll($sql, array($table_name, $col_name)); 71 113 if(count($arrRet) > 0) { 72 114 return true;
Note: See TracChangeset
for help on using the changeset viewer.
