$max) { die("You have a new version than provided by the sql file"); } foreach($versions as $version => $rows) { if($version > $current_version) { print("I should run $version\n"); } }