How to interpeter the output from a MySQL INSERT

Hi,

where to get infos about the Mysql node return after a SQL operation?

I do a
START TRANSACTION;
INSERT INTO...;
INSERT INTO...;
COMMIT;

Everything looks fine on the database side and I get the following output, but how to know from those data that it went fine rather than I got a error?

array[4]
0: object
fieldCount: 0
affectedRows: 0
insertId: 0
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
1: object
fieldCount: 0
affectedRows: 1
insertId: 2185
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
2: object
fieldCount: 0
affectedRows: 1
insertId: 329
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
3: object
fieldCount: 0
affectedRows: 0
insertId: 0
serverStatus: 2
warningCount: 0
message: ""
protocol41: true
changedRows: 0

Why not try doing an insert with an error in it and see what you get out?

well, nice hint, but I was looking for directions to an error description table :grin:

Well in that case, you shoud go to the GitHub repositotary for the node and read thru the javascript of the node to see what it does :rofl:

Seriously, in my mind the best thing to do is try it. It should take you 5 minutes and you will be able to look at the output and see if there is a difference. I don't know if there is any documentation to point you to....

Well the node just reports back what mysql sends it - so really need to look at what sort of errors mysql would send... In the case you have - you send in 4 commands - and got an array of 4 results back (one for each command) - each has a warning count of 0 so I would l say it succeeded.

Thanks dceejay, will check this out.

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