The following is the flow. I'm using input nodes to get the data.
[{"id":"b107d7d0.8bcf98","type":"function","z":"87eeee6.729851","name":"select-query","func":"//var name = {payload: (msg.payload.name)};\n//msg.payload = name;\nvar select = {topic: \"SELECT COUNT(*) AS count FROM test WHERE name='\" + msg.payload.name + \"'\"};\n\nreturn select;","outputs":1,"noerr":0,"x":671,"y":176,"wires":[["23d2748d.b5669c"]]},{"id":"cb5c2136.c89d5","type":"function","z":"87eeee6.729851","name":"insert-query","func":"var name = {payload: (msg.payload.savebutton.name)};\nvar lastname = {payload: (msg.payload.savebutton.lastname)};\nvar code = {payload: (msg.payload.savebutton.code)};\n//msg.payload = [name,lastname,code];\n//var name1 = {payload: (name.payload.savebutton[0])};\n//var lastname = {payload: (msg.payload[0].lastname)};\n//var code = {payload: (msg.payload[0].code)};\n//var count = {payload: (cntStr.payload.count)};\n\n//if (msg.payload[0].count === 0)\n//{\n\tinsert = {topic: \"INSERT INTO test (name,lastname,code) VALUES ('\"+ name.payload +\"','\"+ lastname.payload +\"','\"+ code.payload +\"')\"};\n msg.payload = \"Data inserted successfully!\";\n\treturn [insert,msg];\n/*}\n//else\n//{\n\tactionString = \"Data insertion failed!\";\n\tmsg.payload = actionString;\n return msg;\n}*/\n\n//return msg;","outputs":2,"noerr":0,"x":871,"y":276,"wires":[["2553be2.dd98142"],["a00de898.21c298"]]},{"id":"bd18f1d0.01967","type":"switch","z":"87eeee6.729851","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"savebutton","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":491,"y":176,"wires":[["b107d7d0.8bcf98","4346a1b0.99183"]]},{"id":"7e1ee6ef.c4ec08","type":"mui_button","z":"87eeee6.729851","name":"save-button","group":"862f3f87.367da","order":5,"width":0,"height":0,"passthru":false,"label":"Save","color":"","bgcolor":"","icon":"","payload":"{}","payloadType":"global","topic":"savebutton","x":151,"y":276,"wires":[["4f6f5725.bf21d8"]]},{"id":"17abf0bb.ba670f","type":"mui_dropdown","z":"87eeee6.729851","name":"lastname","label":"","place":"Select Last Name","group":"862f3f87.367da","order":3,"width":0,"height":0,"passthru":false,"options":[{"label":"Rishan","value":1,"type":"num"},{"label":"Login","value":2,"type":"num"}],"payload":"","topic":"lastname","x":141,"y":156,"wires":[["4f6f5725.bf21d8"]]},{"id":"a8d9a9b0.81f358","type":"mui_text_input","z":"87eeee6.729851","name":"code","label":"Code","group":"862f3f87.367da","order":4,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"code","x":131,"y":216,"wires":[["4f6f5725.bf21d8"]]},{"id":"4f6f5725.bf21d8","type":"join","z":"87eeee6.729851","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":331,"y":176,"wires":[["bd18f1d0.01967"]]},{"id":"ea75af48.2081b","type":"switch","z":"87eeee6.729851","name":"","property":"payload[0].count","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":691,"y":376,"wires":[["4346a1b0.99183"],["617d5616.2edfb8"]]},{"id":"617d5616.2edfb8","type":"function","z":"87eeee6.729851","name":"failure-msg","func":"msg.payload = \"Data insertion failed!\";\nreturn msg;","outputs":1,"noerr":0,"x":871,"y":476,"wires":[["a00de898.21c298"]]},{"id":"4346a1b0.99183","type":"join","z":"87eeee6.729851","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":691,"y":276,"wires":[["cb5c2136.c89d5"]]},{"id":"23d2748d.b5669c","type":"link out","z":"87eeee6.729851","name":"select-output","links":["28a57ab7.f38e96"],"x":796,"y":176,"wires":[]},{"id":"7dcb6f8e.54a73","type":"link in","z":"87eeee6.729851","name":"switch-input","links":["f51faf38.14fbf"],"x":576,"y":376,"wires":[["ea75af48.2081b"]]},{"id":"2553be2.dd98142","type":"link out","z":"87eeee6.729851","name":"insert-output","links":["d30ab41a.fdd448"],"x":1016,"y":176,"wires":[]},{"id":"853c9662.1fd928","type":"mui_text_input","z":"87eeee6.729851","name":"name","label":"Name","group":"862f3f87.367da","order":1,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"name","x":130,"y":100,"wires":[["4f6f5725.bf21d8"]]},{"id":"a00de898.21c298","type":"debug","z":"87eeee6.729851","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1070,"y":380,"wires":[]},{"id":"862f3f87.367da","type":"mui_group","z":"","name":"Input Test - Multiple Users","tab":"29df8a3d.2c7ba6","order":1,"disp":true,"width":"6","collapse":false},{"id":"29df8a3d.2c7ba6","type":"mui_tab","z":"","name":"I4Inari (Test)","icon":"dashboard","order":3}]