# Write data into array

**URL:** <https://discourse.nodered.org/t/write-data-into-array/70960>\
**Category:** General\
**Created:** [21 November 2022 09:13 UTC](https://discourse.nodered.org/t/write-data-into-array/70960 "2022-11-21T09:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nika29](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@nika29](https://discourse.nodered.org/u/nika29)\
**Post date:** [21 November 2022 09:13 UTC](https://discourse.nodered.org/t/write-data-into-array/70960/1 "2022-11-21T09:13:47Z")

</div>

Hi there,  
I'd like to write data (taken out of the sqldatabase or the node 'form') into an array. Could you help please how I can do this. I was thinking about creating an empty array and then push the data into it.  
Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [21 November 2022 09:18 UTC](https://discourse.nodered.org/t/write-data-into-array/70960/2 "2022-11-21T09:18:21Z")

</div>

If you use this node it will return the results from a 'MySQL database query' as an array - job done for you.

> **[node-red-node-mysql](https://flows.nodered.org/node/node-red-node-mysql)**
>
> A Node-RED node to read and write to a MySQL database

---

<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:** [20 January 2023 09:18 UTC](https://discourse.nodered.org/t/write-data-into-array/70960/3 "2023-01-20T09:18:42Z")

</div>

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