summaryrefslogtreecommitdiff
path: root/mtg-pdf.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-07-21 11:38:21 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-07-21 11:38:21 +0200
commit89087769ab74fa79e279ebc6f0e92bea05a64c8a (patch)
treef376d07b0d55558f71548a066e0fac07a7391a4c /mtg-pdf.php
parenta50f4c0a4b8b87c36d02d0636e58aa60a6b92b39 (diff)
remove name from sql select in case of slightly erroneous names
Diffstat (limited to 'mtg-pdf.php')
-rw-r--r--mtg-pdf.php8
1 files changed, 4 insertions, 4 deletions
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'] ?? '';