Blockquote
[
{
"id": "595824d334f50ad0",
"type": "tab",
"label": "db test",
"disabled": false,
"info": "",
"env":
},
{
"id": "193246244b0ceb0a",
"type": "function",
"z": "595824d334f50ad0",
"name": "testing query",
"func": "var myMsg = msg.payload\n\n// t=msg.topic="SELECT DateAndTime, Temperature, Humidity, BarrPress FROM 'temp-at-interrupt' where minute(Time)= '00' order by DateAndTime DESC LIMIT '"+msg.payload+"'";\n\n\n// t = "SELECT * FROM NodeRed.7bchannels WHERE channel="+msg.payload \n// return {topic:t} Probably need to format payload as a string: t = "SELECT * FROM NodeRed.7bchannels WHERE channel='"+msg.payload+"'" \n\n//var t = "SELECT DateAndTime, Temperature, Humidity, BarrPress FROMweather_1
where minute(Time)= '00' order by DateAndTime DESC LIMIT " + myMsg\n//var t = "select * FROMweather_1
DESC LIMIT 5" // + myMsg\n\n//return {topic:t}\n//\nmsg.topic="select * from weather_1 limit 5"\nreturn msg\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": ,
"x": 330,
"y": 180,
"wires": [
[
"c8df24e1eb336d1a",
"e7c6b6e59db57194",
"9f53dada8eb45390"
]
]
},
{
"id": "0809a9ec086585de",
"type": "inject",
"z": "595824d334f50ad0",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "12",
"payload": "12",
"payloadType": "str",
"x": 120,
"y": 180,
"wires": [
[
"193246244b0ceb0a",
"47e7279e882583b2"
]
]
},
{
"id": "c8df24e1eb336d1a",
"type": "debug",
"z": "595824d334f50ad0",
"name": "debug 3",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 100,
"wires":
},
{
"id": "e7c6b6e59db57194",
"type": "mysql-r2",
"z": "595824d334f50ad0",
"name": "bme680_v2 DB mysql-r2",
"host": "127.0.0.1",
"database": "bme680_v2",
"username": "root",
"password": "mariadb.",
"sql": "",
"port": "3306",
"pooling": false,
"waitForConnections": true,
"connectionLimit": "10",
"queueTimeout": "10000",
"x": 570,
"y": 200,
"wires": [
[
"d55fcb955620b074"
]
]
},
{
"id": "cb73c6d3d323e94b",
"type": "debug",
"z": "595824d334f50ad0",
"name": "debug 4",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 320,
"wires":
},
{
"id": "47e7279e882583b2",
"type": "debug",
"z": "595824d334f50ad0",
"name": "timer out",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 320,
"y": 120,
"wires":
},
{
"id": "d55fcb955620b074",
"type": "debug",
"z": "595824d334f50ad0",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 740,
"y": 160,
"wires":
},
{
"id": "9f53dada8eb45390",
"type": "mysql",
"z": "595824d334f50ad0",
"mydb": "fe6d1b3da8c52fe3",
"name": "mysql",
"x": 510,
"y": 280,
"wires": [
[
"cb73c6d3d323e94b"
]
]
},
{
"id": "fe6d1b3da8c52fe3",
"type": "MySQLdatabase",
"name": "mysql",
"host": "127.0.0.1",
"port": "3306",
"db": "bme680_v2",
"tz": "",
"charset": "UTF8"
}
]
Blockquote
I'm using mariadb with the same function node.
I would like to use the latest and great but it fails
Thanks