# Node red to database

**URL:** <https://discourse.nodered.org/t/node-red-to-database/10477>\
**Category:** General\
**Created:** [23 April 2019 19:48 UTC](https://discourse.nodered.org/t/node-red-to-database/10477 "2019-04-23T19:48:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ihebabidi](https://avatars.discourse-cdn.com/v4/letter/i/e47c2d/32.png) [@ihebabidi](https://discourse.nodered.org/u/ihebabidi)\
**Post date:** [23 April 2019 19:48 UTC](https://discourse.nodered.org/t/node-red-to-database/10477/1 "2019-04-23T19:48:07Z")

</div>

hello all !  
im trying to get the temperature value from a data base to node and this is my flow `[{"id":"a68c4741.10f2b8","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"9543390d.1e0c88","type":"debug","z":"a68c4741.10f2b8","name":"","active":true,"console":"false","complete":"false","x":750,"y":60,"wires":[]},{"id":"1f86ca6f.5599b6","type":"function","z":"a68c4741.10f2b8","name":"prepareHtml","func":"var temp = {};\nvar html = \"<table width='100%'><tr><td width='75%'>Date</td><td width='25%'>Température</td></tr>\";\nfor(var i in msg.payload)\n{\n temp = msg.payload[i];\n html += \"<tr><td>\"+temp.date+\"</td><td>\"+temp.temperature+\"</td></tr>\";\n}\nhtml += \"</table>\";\nmsg.payload = html;\nreturn msg;","outputs":1,"noerr":0,"x":610,"y":200,"wires":[["8e9915.95cf86e8","9543390d.1e0c88"]]},{"id":"8e9915.95cf86e8","type":"ui_template","z":"a68c4741.10f2b8","group":"18ee1f57.1d8f21","name":"","order":7,"width":"16","height":"6","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":840,"y":160,"wires":[[]]},{"id":"8f377d12.67306","type":"inject","z":"a68c4741.10f2b8","name":"","topic":"SELECT * FROM temperature ;","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":160,"y":160,"wires":[["72fd4127.b3144"]]},{"id":"72fd4127.b3144","type":"mysql","z":"a68c4741.10f2b8","mydb":"20c84aa7.7b3e86","name":"MYSQL","x":400,"y":100,"wires":[["1f86ca6f.5599b6"]]},{"id":"18ee1f57.1d8f21","type":"ui_group","z":"","name":"Températures du processeur","tab":"bd5e44ed.c2ba68","order":5,"disp":true,"width":"24","collapse":true},{"id":"20c84aa7.7b3e86","type":"MySQLdatabase","z":"","host":"127.0.0.1","port":"3306","db":"analyse de la temperature","tz":""},{"id":"bd5e44ed.c2ba68","type":"ui_tab","z":"","name":"BDD","icon":"dashboard"}]`  
it is supposed to look like this

 ![nodeRedBddTableauResultat](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e5af344304f82eacddf326dd5d166e9698d870f7.png)  
but it is like this ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/158f7a70f77378d2bd3daf996029fdf4b055b78b.png)  
any one can help me pls

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [23 April 2019 20:00 UTC](https://discourse.nodered.org/t/node-red-to-database/10477/2 "2019-04-23T20:00:38Z")

</div>

use 3 backticks `

```auto
flow code

```

3 backticks again `

If it is undefined, it is undefined, so you have to check what the input is.

---

<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:** [23 April 2019 22:49 UTC](https://discourse.nodered.org/t/node-red-to-database/10477/3 "2019-04-23T22:49:13Z")

</div>

My first suggestion would be to put a debug node on the output of the `mysql` node and see what you are getting back
