Answer the question
In order to leave comments, you need to log in
How to make a request and immediately display it on the screen?
I make a request connection.query("INSERT INTO ... It creates a new line, how can I immediately pick up a column from this line?
At the time of creation, one of the columns is automatically affixed (id), I immediately display this id after creation.
You can, of course, do immediately another request that will take the last added BUT, it is not clear how this will behave if 2 people simultaneously create
Answer the question
In order to leave comments, you need to log in
When using INSERT, and set to autoincrement, you can get the id of the newly added column like this: result.insertId
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question