I’m tring to figure out how to parameterize queries in base. I have the follwing that runs on mysql directly:
SET @var = 1155;
SELECT i.*, t.name
FROM items i
LEFT JOIN item_tags it ON it.item_id = i.id
LEFT JOIN tags t ON it.tag_id = t.id
WHERE i.id=@var;
That query will not run on base(syntax errors), the closest i can get is:
SELECT i.*, t.name
FROM items i
LEFT JOIN item_tags it ON it.item_id = i.id
LEFT JOIN tags t ON it.tag_id = t.id
WHERE i.id=?;
Where i receive: “The data content could not be loaded. Value not set for all parameters” I need some more information on how to make this work, what the actual proper syntax is, and how to specify the parameters.
I am direct connected to the mysql db, and am running the sql “directly”