= 250 LIMIT 1'; $minrows = 1; break; case '300': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 300 LIMIT 1'; $minrows = 1; break; case '310': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 310 LIMIT 1'; $minrows = 1; break; case '320': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 320 LIMIT 1'; $minrows = 1; break; case '330': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 330 LIMIT 1'; $minrows = 1; break; case '331': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 331 LIMIT 1'; $minrows = 1; break; case '340': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 340 LIMIT 1'; $minrows = 1; break; case '350': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 350 LIMIT 1'; $minrows = 1; break; case '360': $query = 'SELECT * FROM '.sql_table('config').' WHERE name=\'DatabaseVersion\' and value >= 360 LIMIT 1'; $minrows = 1; break; } $res = mysql_query($query); $installed = ($res != 0) && (mysql_num_rows($res) >= $minrows); return $installed; } /** this function gets the nucleus version, even if the getNucleusVersion * function does not exist yet * return 96 for all versions < 100 */ function upgrade_getNucleusVersion() { if (!function_exists('getNucleusVersion')) return 96; return getNucleusVersion(); } function upgrade_showLogin($type) { upgrade_head(); ?>
下記の情報を入力して下さい:
メッセージは以下の通り:
アップグレード最初のページにもどる
$friendly ... "; $res = mysql_query($query); if (!$res) { echo "失敗\n"; echo "失敗の理由: " . mysql_error() . ""; $upgrade_failures++; } else { echo "成功!
Errors occurred during upgrade process.'; } /** * @param $table * table to check (without prefix) * @param $aColumns * array of column names included */ function upgrade_checkIfIndexExists($table, $aColumns) { // get info for indices from database $aIndices = array(); $query = 'show index from ' . sql_table($table); $res = mysql_query($query); while ($o = mysql_fetch_object($res)) { if (!$aIndices[$o->Key_name]) { $aIndices[$o->Key_name] = array(); } array_push($aIndices[$o->Key_name], $o->Column_name); } // compare each index with parameter foreach ($aIndices as $keyName => $aIndexColumns) { $aDiff = array_diff($aIndexColumns, $aColumns); if (count($aDiff) == 0) return 1; } return 0; } /** * Checks to see if a given table exists * * @param $table * Name of table to check for existance of * Uses sql_table internally * @return true if table exists, false otherwise. */ function upgrade_checkIfTableExists($table){ $query = 'SHOW TABLES LIKE \''.sql_table($table).'\''; $res = mysql_query($query); return ($res != 0) && (mysql_num_rows($res) == 1); } /** * Checks to see if a given configuration value exists * * @param $value * Config value to check for existance of. * Paramater must be MySQL escaped * @return true if configuration value exists, false otherwise. */ function upgrade_checkIfCVExists($value){ $query = 'SELECT name from '.sql_table('config').' WHERE name = \''.$value.'\''; $res = mysql_query($query); return ($res != 0) && (mysql_num_rows($res) == 1); } /** * Checks to see if a given column exists * * @param $table * Name of table to check for column in * Uses sql_table internally * @param $col * Name of column to check for existance of * @return true if column exists, false otherwise. */ function upgrade_checkIfColumnExists($table, $col){ $query = 'DESC `'.sql_table($table).'` `'.$col.'`'; $res = mysql_query($query); return ($res != 0) && (mysql_num_rows($res) == 1); } ?>