Jump to content

Mysql insert and update two different table

Recommended Posts

I am Learner and I was building one app for learning purpose I have been stuck at one place from several days I have already write this question to other forums but did not get any working answer of this I am building one app where I need to insert some value to one table and need to update this last inserted Id to other table this all goes in single click in my app for this I am using Mysql database for which I wrote query insert into table name (field1, field2......) values (val1, val2.......); update table_name SET column_name where table_name.column_name IN(val1,val2,val3) when I am using this query in PHPmyadmin I am getting okay result but when I am doing same thing with nodejs app I am getting reserve word error from MySQL maybe because of using two queries in one statement I have also tried stored procedure but when I am using stored Procedure I am facing problem in passing array value to mysql variable 

If any one required any other details please contact me I will share code also

Link to post
Share on other sites

Sharing some code might work well here.

It sounds like you're attempting to define a word that nodejs already uses. It might have nothing to do with your SQL.
We can't know for sure without seeing a little bit of code.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...