MYSql - how to update data

Hi Bubblers!

How do we go about updating data to a MySQL database?


All I’m trying to achieve above is change someone’s callsign, but I get the below error, any help?

image

Please someone must know? :sob:

Hello,

Try the following one, please:

Also, you need to have kind of the next query:

UPDATE table_name
SET "column1" = $1
WHERE "id" = $2;

Without specifying which record you need to update, you will update all of them.

Link:
https://www.tutorialspoint.com/sql/sql-update-query.htm

Hi,

image

Although in the mySQL database, it does exist?

image

This is the query at the moment…

Try to replace ” with ".

I’ve updated my comment:
image

image

That broke all of it changing that :confused:

Can you paste a screenshot of your current query, please?

Shall I sent an editor link maybe?

yes, please

does this work?

Nope. It’s a preview link.

image
change it to:

UPDATE department_members
SET "callsign" = $1
WHERE "userID" = $2;

The quotes should be ".

image

Using your quotes, it causes everything to break, I think it’s a keyboard thing?

When I use mine, I get the below screenshot;

image

I have changed perms in my app, you should be able to access the editor via that link above?

Thanks for providing the access.

The next one works:

UPDATE department_members
SET `callsign` = callsign
WHERE `userID` = userID;

So, `` these for column names.
I see that we cannot use $ as variables. We need to type the names of the added parameters.

2 Likes

You are a star! Thank you very much! :slight_smile: Appreciate the help you’ve given me!

2 Likes

Have you tested it out via workflows to ensure if that works?

1 Like

I’ll do a quick mockup of it now, standby :slight_smile:

Ah, it isn’t actually updating the value on the MySQL datbase :open_mouth: