"Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1"
msg.topic = "Insert into mytable(DeviceId,Line,outPIN,count,Time) values (?,?,?,?,?,);"
"Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1"
msg.topic = "Insert into mytable1(DeviceId,Line,outPIN,count,Time) values (?,?,?,?,?);"
"Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?)' at line 1"
Just for info on mytable1:
CREATE TABLE mytable1 ( ID INT(11) NOT NULL AUTO_INCREMENT, DeviceId INT(5) NULL DEFAULT NULL, Line INT(5) NULL DEFAULT NULL, outPIN VARCHAR(10) NULL DEFAULT NULL COMMENT 'GPIO', count INT(5) NULL DEFAULT NULL, Time TIMESTAMP NOT NULL DEFAULT '',
PRIMARY KEY (ID)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB
AUTO_INCREMENT=37
;
I would suggest you step back and make sure you can do an insert with actual values before moving onto the ? marks and use the values from the forst element in the array.
Which node-red node are you using to insert into mariadb? Does it even support passing in a array of data to do multiple inserts? I'm not aware of any node that does support doing that.
Can I just check that you mean you cannot insert one row by passing in an array of values in the payload such as [ '1','1', 'GPIO1','15','2018-09-23 08:14:45']. If so then as I suggested look in the mariadb log, but also give us the information @knolleary has asked for.
Please try and answer questions asked, it is difficult to help if you don't, you have not answered @knolleary's question as to which node you are using to access the data (possible one of the node-red-contrib nodes). Also you have not said what you see in the mariadb log, which can show you exactly the query that is failing.