Help with nodered mysql databse

hello everyone , i m new in this forum
my project is read data from my plcsim 1200 and save it in mysql database .
i don't know what i should set in my function
please help me .
thnx a lot1 Sans titre

Do you mean you don't know what SQL query to use or you don't know how to generate the query in node red?

1 Like

yes sir ! i dont know what i should generate in red node ,
in my exempl , the input is : 2247 , my database in configured , i need only the function to save the number in my database
thnx a lot

This isn't really the right forum to learn about SQL (which is nothing to do with node-red of course). I would start by finding a mysql tutorial to show you the basics. Once you know what query you want to create in node-red then come back and ask for help on exactly how to do that if you are having problems.
This looks as if it might be a good place to start

Once you have figured out your query, might I suggest using the template node to build the query instead of a function node. I find it much easier to do.

Take a look inn the Flows tab and search for 'MYSQL example to chart data' to see an example.

thank you sir for your response ,
I just started on node-red, after adding 'template' I don't know how to fill it out
i try this function and it's don't work 3 4

Did you import the example flow and look at what it is doing?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.