Forum Academy Marketplace Showcase Pricing Features

Unsure how params work with the bubble SQL plugin

Hi there. I’ve got my mySQL DB server set up and ready to use with Bubble and have tried a few queries and found it to be working. But now I need to actually use my DB; I cannot seem to be able to use the parameters. It would be nice if this was documented more, because I’ve been trying to guess how I add the parameters into my query to no avail.

^ (FYI I had previously pressed the “Update query types” button. I just forgot to for this screenshot)

Using this on my site results in the following:
Which is not the intended result.

^ Here is the same object in the editor

^ But if I replace the parameter with my_id, it performs as expected, clearly indicating that I either don’t know how to use Bubble’s parameters or the plugin is broken

If you are using MySQL, you use a question mark for the parameter in your query string. The parameters map in order to the question marks in the statement. Your select statement should be:

select members from serverData where serverId=? limit 1;

For types of text, you don’t need to include quotes. To test your query, try this then for your parameter:

$1 Name serverID Type text test value my_id.

You have to be able to get the Update query types to work, so you can then map the fields. Then in your workflow, you can pass any text string to the parameter.