$dbdbversion) { echo "DB update requirements detected\n"; echo "Current DB Version: $dbdbversion\n"; echo "Current CODE Version: $dbcodeversion\n"; //first, make sure we have write access to the db.db.version.txt //otherwise, we will not be able to save the new version number //which would screw things up. if(is_writable("db.db.version.txt")) { echo "Updating database from $dbdbversion to $dbcodeversion\n"; //include the config.inc.php //so we have the db connection info require("../data/config.inc.php"); for($ver=$dbdbversion+1;$ver<=$dbcodeversion;$ver++) { if(file_exists("db.update.$ver.sql")) { echo "db.update.$ver.sql detected - running...\n"; readfile("db.update.$ver.sql"); echo "\n"; system("mysql -h$DBHOST -u$DBUSER -p$DBPASS $DBNAME