Copying my Door control status back to my Mysql databse

Do you understand why I suggest adding a Change node? If you understand why then the answer to where should be clear.

So let me repeat what I said:

From what I recall of the previous thread, you start with the ID in msg.payload but it gets overwritten when you do the database lookup.

In which case, I suggest you add a Change node after the MQTT node, at the start of the flow,

Let me try to explain that again.

At the moment, you have the ID in msg.payload when it comes out of the MQTT node.

You then pass it to a Template node where you build an SQL query in msg.topic to lookup the ID in the table.

You then pass that to the mysql node to run the query. That node puts its result in msg.payload. This overwrites the old value of msg.payload, so the message no longer contains the ID.

Your flow looks like:

MQTT -> Template -> MySQL -> ....

So you need to find a way to keep the ID on the message. The best way of doing that is to copy its value to a different message property that will not get overwritten by the other nodes.

You can do that with the Change node:

MQTT -> Change -> Template -> MySQL -> ...

And configure that Change node to set msg.id to msg.payload.

You should then find msg.id contains the RFID value later on in your flow - use a Debug node to check that.

If you don't understand any of that, then please try to explain what part you don't understand.