$UserID] )->fetchColumn(); // add the last gear to their character appearance $charapp .= ";http://{$_SERVER['HTTP_HOST']}/Asset/?id={$LastGearID}"; } else if ($ServerID || $PlaceID) { // get the server's allowed gears if ($ServerID) { $gears = db::run("SELECT allowed_gears FROM selfhosted_servers WHERE id = :ServerID", [":ServerID" => $ServerID])->fetchColumn(); } else { $gears = db::run("SELECT gear_attributes FROM assets WHERE id = :PlaceID", [":PlaceID" => $PlaceID])->fetchColumn(); } // get everything they're wearing, and the allowed gears if($gears) { $gears = json_decode($gears, true); $querystring .= " AND (gear_attributes IS NULL"; foreach($gears as $GearAttribute => $GearEnabled) { if(!$GearEnabled) continue; $querystring .= " OR JSON_EXTRACT(gear_attributes, \"$.{$GearAttribute}\")"; } $querystring .= ")"; } } // and get them all $assets = db::run($querystring, [":UserID" => $UserID]); while ($asset = $assets->fetch(PDO::FETCH_OBJ)) { $charapp .= ";http://{$_SERVER['HTTP_HOST']}/Asset/?id={$asset->assetId}"; } echo $charapp; // echo Users::GetCharacterAppearance($uid, $sid, $host);