flash.moe/public/collection/game.php
2021-07-31 04:39:10 +00:00

42 lines
986 B
PHP

<?php
require_once '_inc.php';
$gameId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$getGame = $pdo->prepare('
SELECT *
FROM `col_games`
WHERE `game_id` = :game
');
$getGame->bindValue('game', $gameId);
$getGame->execute();
$game = $getGame->fetch(PDO::FETCH_OBJ);
if(empty($game)) {
http_response_code(404);
die('No such game.');
}
$getOwnership = $pdo->prepare('
SELECT *
FROM `col_games_ownership`
WHERE `game_id` = :game
');
$getOwnership->bindValue('game', $gameId);
$getOwnership->execute();
$ownership = $getOwnership->fetchAll(PDO::FETCH_OBJ);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Game Collection</title>
<link href="assets/style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="wrapper">
<h1><a href="./">Game Collection</a></h1>
<?php var_dump($game, '<br/>', $ownership); ?>
</div>
</body>
</html>