Giamma
1
Hi,
this is an update query ...
const stato2 = "F";
msg.topic = "UPDATE ListaSpesa SET Stato = '" + stato2 + "' WHERE Prodotto = 'Beer'"
and it works fine ....
but if I need to set with a variable (string) the condition Where, how it will be the query?
const stato2 = "F";
const prodotto = "Beer";
msg.topic = "UPDATE ListaSpesa SET Stato = '" + stato2 + "' WHERE Prodotto = ?????
I couldn't do it ....
E1cid
2
const stato2 = "F";
const prodotto = "Beer";
msg.topic = "UPDATE ListaSpesa SET Stato = '" + stato2 + "' WHERE Prodotto = '" + prodotto + "'"
should work
Or
You could use string template
msg.topic = `UPDATE ListaSpesa SET Stato = '${stato2}' WHERE Prodotto = '${prodotto}'`
1 Like
Giamma
3
Works!
Thank you, thank you very much ....
system
Closed
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.