/** * Populate 'installed_patches' database */ public function populateInstalledPatchesTable() { if (is_null($this->Connection)) { $this->setWebsiteDatabase(); } $Patches = json_decode($this->getDatabases(), true); $InstalledPatches = []; foreach ($Patches as $Patch) { if (isset($Patch['patch_name'])) { $InstalledPatches[] = ['real_patch' => $Patch['patch_real'], 'site_patch' => $Patch['game_patch'], 'site_link' => $this->getPatchMatch($Patch['game_patch'])['short'], 'patch_name' => $Patch['patch_name']]; } } $InstallQuery = "INSERT INTO installed_patches (`real_patch`, `site_patch`, `site_link`, `patch_name`) VALUES (:real_patch, :site_patch, :site_link, :patch_name);"; foreach ($InstalledPatches as $Patch) { Database::parameterizedSQLPDO($this->Connection, $InstallQuery, $Patch); } }