# Error: ER\_PARSE\_ERROR, error in your SQL syntax

**URL:** <https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984>\
**Category:** General\
**Created:** [20 January 2022 19:02 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984 "2022-01-20T19:02:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdrianFV](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/adrianfv/32/54676_2.png) [@AdrianFV](https://discourse.nodered.org/u/AdrianFV)\
**Post date:** [20 January 2022 19:02 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984/1 "2022-01-20T19:02:09Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/2130ea1bb74aeca74e4fd74aaaef00ca73725557.png)

I don't know what is happening, I've tried everything, the code is simple and it gives me the error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'humidity\_AF' at line 1"

I have two topics, temperature\_AF works, but when i try to send the data from the topic of humidity\_AF it doesn't work.

```auto
var humedad = msg.payload;

msg.payload = "INSERT INTO `humedad`(`Humedad`) VALUES (" + humedad + ")";

return msg;

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 January 2022 19:10 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984/2 "2022-01-20T19:10:17Z")

</div>

The QUERY needs to be in msg `topic` not `payload`.

you got it correct for termpertura!

**Always read the built-in help for the node (help is in the side bar on the right)**

---

<div class="post-metadata">

**Author:** ![AdrianFV](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/adrianfv/32/54676_2.png) [@AdrianFV](https://discourse.nodered.org/u/AdrianFV)\
**Post date:** [20 January 2022 19:12 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984/3 "2022-01-20T19:12:04Z")

</div>

Thanks, im stupid

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 January 2022 19:14 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984/4 "2022-01-20T19:14:13Z")

</div>

No worries, it happens.

If it fixes your issue, please mark the post as soved.

Ta.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 February 2022 19:15 UTC](https://discourse.nodered.org/t/error-er-parse-error-error-in-your-sql-syntax/56984/5 "2022-02-03T19:15:04Z")

</div>

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