$cfg->error = true; $cfg->emessage = 'Could not select data from your database, check that tables and data are properly created/inserted.'; } else { foreach ($reschk as $row) { if ($row['num'] > 0) { $dbInstallWorked = true; break; } } } $ver = new \nzedb\utility\Versions(); $patch = $ver->getSQLPatchFromFiles(); $pdo->setSetting(['..sqlpatch' => $patch]); if ($dbInstallWorked) { $ver = new \nzedb\utility\Versions(); $patch = $ver->getSQLPatchFromFiles(); if ($patch > 0) { $updateSettings = $pdo->setSetting(['section' => '', 'subsection' => '', 'name' => 'sqlpatch', 'value' => $patch]); } else { $updateSettings = false; } // If it all worked, move to the next page. if ($updateSettings) { header("Location: ?success"); if (file_exists($cfg->DB_DIR . '/post_install.php')) { exec("php " . $cfg->DB_DIR . "/post_install.php {$pdo}"); } exit; } else { $cfg->error = true; $cfg->emessage = "Could not update sqlpatch to '{$patch}' for your database.";