Step 1: Verify that the database has not already been upgraded.
";
if(!$db = mysql_connect("$dbhost", "$dbuser", "$dbpasswd"))
die("Error, I could not connect to the database at $dbhost. Using username $dbuser.
Please go back and try again.");
if(!@mysql_select_db("$dbname", $db))
die("Database $dbname could not be found");
echo "Checking for default_lang in the config table...
";
flush();
$r = mysql_query("select default_lang from config limit 1", $db);
if (1054 != mysql_errno($db)) {
die ("The column exists, the database has already been upgraded.");
} else {
echo " OK, it does not exist.
";
}
echo "Checking for user_lang in the users table...
";
flush();
$r = mysql_query("select user_lang from users limit 1", $db);
if (1054 != mysql_errno($db)) {
die ("The column exists, the database has already been upgraded.");
} else {
echo " OK, it does not exist.
";
}
echo "Checking for forum_pass in the forums table...
";
flush();
$r = mysql_query("select forum_pass from forums limit 1", $db);
if (0 != mysql_errno($db)) {
die ("The column does not exist, the database has already been upgraded.");
} else {
echo " OK, it exists.
";
}
echo "Checking for the forum_access table...
";
flush();
$r = mysql_query("select * from forum_accessx limit 1", $db);
if (1146 != mysql_errno($db)) {
die ("The table exists, the database has already been upgraded.");
} else {
echo " OK, it does not exist.
";
}
echo "Good!
";
?>