# Could not save PLC output data from mqtt node to MySQL

**URL:** <https://discourse.nodered.org/t/could-not-save-plc-output-data-from-mqtt-node-to-mysql/86384>\
**Category:** Industrial\
**Created:** [13 March 2024 00:43 UTC](https://discourse.nodered.org/t/could-not-save-plc-output-data-from-mqtt-node-to-mysql/86384 "2024-03-13T00:43:54Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [30 March 2024 08:51 UTC](https://discourse.nodered.org/t/could-not-save-plc-output-data-from-mqtt-node-to-mysql/86384/12 "2024-03-30T08:51:49Z")

</div>

> [@Results in the MySQL database are all 0 for all columns](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857/3):
>
> > [@Results in the MySQL database are all 0 for all columns](https://discourse.nodered.org/t/results-in-the-mysql-database-are-all-0-for-all-columns/86857/1):
> >
> > why the results in the MySQL database are all 0 for all columns
> 
> Because that is what you have told it to do.

It is interesting that the only SQL @Sobri has shown us inserts empty strings in every field yet the phpMyAdmin screendump shows zero in every field apart from '$ProductName' in ProductName.  
I don't believe that the SQL shown can possibly create the records shown. I would expect an SQL error attempting to write a string to a numeric field.

@Sobri: I suggest that you create a new data table with just a few fields and a simple flow to insert records.  
If you still get problems you have to share the flow, the input data, the database schema and the records created. Then there is a chance we might be able to help you fix it.

---

_[View the full topic](https://discourse.nodered.org/t/could-not-save-plc-output-data-from-mqtt-node-to-mysql/86384)._
