$dbdbversion) { echo "DB update requirements detected\n"; echo "Current DB Version: $dbdbversion\n"; echo "Current CODE Version: $dbcodeversion\n"; echo "Updating database from $dbdbversion to $dbcodeversion\n"; //include the config.inc.php //so we have the db connection info require("../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