Hi there! I'm having trouble with today's new snippet:
Situation:
I have a Data Blaze table of books, including their ISBN, the eBook ISBN, and the title.
Many books have two formats, like a paperback and hardcover. These books have different ISBNs but the same title. If there IS an ebook, the ebook ISBN will match for both titles, but not all books have an ebook, so this isn't a good match condition; I would like to use the title to match.
I want to look up a book in DB based on ISBN. Then I also want to display the other format of this book.
When I match based on ebook ISBN, it's working as expected (but as mentioned above, this isn't a good idea generally). And for debugging purposes I confirmed that the titles of the two formats do match.
Key title ISBN: {formtext: name=keyisbn}
{dbselect: SELECT Title, Format, `ISBN-13`, EBOOK FROM BrandsTitles WHERE contains(`ISBN-13`, `@keyisbn`) LIMIT 800; space=4PBMN6kQLs5Gmzuvk8bha6; menu=yes}
{dbselect: SELECT Format AS Format2, `ISBN-13` AS ISBN2, EBOOK AS EBOOK2, Title AS Title2
FROM BrandsTitles
WHERE EBOOK = @ebook AND `ISBN-13` <> `@isbn-13`; space=4PBMN6kQLs5Gmzuvk8bha6; menu=no}
Key title:
{=format}{=`isbn-13`} {=title}
Secondary format:
{=format2}{=isbn2} {=title2}
{if: title=title2}titles match{else}titles don't match{endif}
When I match based on title, I'm getting "no results found" for the second DB query. Why could this be happening, and is there a better way to do it? I realize that without including the DB table, this could be hard to troubleshoot, but I can't include it here for data privacy reasons.
Key title ISBN: {formtext: name=keyisbn}
{dbselect: SELECT Title, Format, `ISBN-13`, EBOOK FROM BrandsTitles WHERE contains(`ISBN-13`, `@keyisbn`) LIMIT 800; space=4PBMN6kQLs5Gmzuvk8bha6; menu=yes}
{dbselect: SELECT Format AS Format2, `ISBN-13` AS ISBN2, EBOOK AS EBOOK2, Title AS Title2
FROM BrandsTitles
WHERE Title = `@title` AND `ISBN-13` <> `@isbn-13`; space=4PBMN6kQLs5Gmzuvk8bha6; menu=no}
Key title:
{=format}{=`isbn-13`} {=title}
Secondary format:
{=format2}{=isbn2} {=title2}