# Inserting to mySql database

**URL:** https://discourse.nodered.org/t/inserting-to-mysql-database/24294
**Category:** General
**Created:** [5 April 2020 23:26 UTC](https://discourse.nodered.org/t/inserting-to-mysql-database/24294 "2020-04-05T23:26:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![iankillz](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@iankillz](https://discourse.nodered.org/u/iankillz)
#### Post date: [5 April 2020 23:26 UTC](https://discourse.nodered.org/t/inserting-to-mysql-database/24294/1 "2020-04-05T23:26:17Z")

</div>

Hello guys, I need help inserting the value from a function to my MySql database but every time I deploy, it says "Error: ER\_BAD\_FIELD\_ERROR: Unknown column 'available' in 'field list'" "

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84fbf32c1e6603db40dfd6296ee163a9ccfca761.jpeg)  
This is my flow so the change node switches the payload into string then that goes to the insert query function  
msg.topic = "INSERT INTO `parking`(`Slot 1`) VALUES(`"+ msg.payload +"`)";  
return msg;

---

<div class="post-metadata">

### Author: ![iankillz](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@iankillz](https://discourse.nodered.org/u/iankillz)
#### Post date: [5 April 2020 23:27 UTC](https://discourse.nodered.org/t/inserting-to-mysql-database/24294/2 "2020-04-05T23:27:20Z")

</div>

```auto
msg.topic = "INSERT INTO `parking`(`Slot 1`) VALUES(`"+ msg.payload +"`)";
return msg;

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 April 2020 07:36 UTC](https://discourse.nodered.org/t/inserting-to-mysql-database/24294/3 "2020-04-06T07:36:22Z")

</div>

Has that change fixed it? it is not clear from your post. Mark it as the solution if it has.  
Otherwise start by putting a debug showing what is going _into_ the sql node. Set it to Show Complete Message and check that it shows what you expect.

---

<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: [5 June 2020 07:36 UTC](https://discourse.nodered.org/t/inserting-to-mysql-database/24294/4 "2020-06-05T07:36:25Z")

</div>

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