# Results in the MySQL database are all 0 for all columns

**URL:** https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857
**Category:** General
**Created:** [30 March 2024 01:14 UTC](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857 "2024-03-30T01:14:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sobri](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@Sobri](https://discourse.nodered.org/u/Sobri)
#### Post date: [30 March 2024 01:14 UTC](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857/1 "2024-03-30T01:14:01Z")

</div>

why the results in the MySQL database are all 0 for all columns, can anyone tell me the correct code? The following flow and programming that I made

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68bcf13f0ac188717eaa8cc9a2987b2c5508c34b.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78d582259a0bbee6780358edf707267b7edc9dca.png)

```auto
msg.topic = "INSERT INTO realtimealtprg01 (Speed, ProductName, TensionUW, TensionIF, TensionOf, TensionRW, UW, RW, ProductA, ProductB, ProductTotal ) VALUES ('', '','', '', '', '', '', '', '', '', '');"
return msg;

```

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [30 March 2024 08:23 UTC](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857/2 "2024-03-30T08:23:22Z")

</div>

Please do not duplicate post, it confuses responses. You have responses here [Could not save PLC output data from mqtt node to MySQL](https://discourse.nodered.org/t/could-not-save-plc-output-data-from-mqtt-node-to-mysql/86384)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 March 2024 08:23 UTC](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857/3 "2024-03-30T08:23:58Z")

</div>

> [@Sobri](#):
>
> why the results in the MySQL database are all 0 for all columns

Because that is what you have told it to do. I would suggest you add a `debug` node (set to display the complete msg object) to the output of the `function` node just before your `mysql` node and run your code.

Then look at the output of the debug node and read the 'Help' information of the `mysql` node to see what you have done.

With one line of code and two images, that is the best I can do to help you at this point.

`[This topic has been closed since it is a duplicate]`
