From 89087769ab74fa79e279ebc6f0e92bea05a64c8a Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 21 Jul 2024 11:38:21 +0200 Subject: remove name from sql select in case of slightly erroneous names --- mtg-pdf.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mtg-pdf.php') diff --git a/mtg-pdf.php b/mtg-pdf.php index 068c91e..55b8112 100644 --- a/mtg-pdf.php +++ b/mtg-pdf.php @@ -41,10 +41,10 @@ foreach ($cards as $card) { SELECT cardIdentifiers.scryfallId, cards.layout FROM cardIdentifiers JOIN cards ON cardIdentifiers.uuid=cards.uuid - WHERE (cards.name=:name OR cards.faceName=:name) AND cards.setCode=:setCode AND cards.number=:number + WHERE cards.setCode=:setCode AND cards.number=:number SQL; $statement = $db->prepare($query); - $statement->execute(['name' => $card['name'], 'setCode' => $card['set'], 'number' => $card['number']]); + $statement->execute(['setCode' => $card['set'], 'number' => $card['number']]); $result = $statement->fetch(); $id = $result['scryfallId'] ?? ''; @@ -53,10 +53,10 @@ foreach ($cards as $card) { SELECT tokenIdentifiers.scryfallId, tokens.layout FROM tokenIdentifiers JOIN tokens ON tokenIdentifiers.uuid=tokens.uuid - WHERE (tokens.name=:name OR tokens.faceName=:name) AND tokens.setCode=:setCode AND tokens.number=:number + WHERE tokens.setCode=:setCode AND tokens.number=:number SQL; $statement = $db->prepare($query); - $statement->execute(['name' => $card['name'], 'setCode' => $card['set'], 'number' => $card['number']]); + $statement->execute(['setCode' => $card['set'], 'number' => $card['number']]); $result = $statement->fetch(); $id = $result['scryfallId'] ?? ''; -- cgit v1.2.3