0) $scriptsToRun[intval(pathinfo($i)['basename'])]=$moreItems; } $total=count($scriptsToRun); $dbVersion=0; for ($v=$version;$v<$total;$v++){ foreach ($scriptsToRun[$v] as $s){ echo "Running $s"; $PDO->query(file_get_contents($s)); var_dump($PDO->errorInfo()); } } file_put_contents("db_version_info", $total);