Answer the question
In order to leave comments, you need to log in
Does the correct request manage to be sent to the engine in my case?
There is a piece of code in nodejs. Approximately it looks like this:
mysql.query('SELECT * FROM table WHERE id = '+arr[i]+';', function(err, res){...});
delete arr[i];
Answer the question
In order to leave comments, you need to log in
It shouldn't work, because you can't write like that.
If the deletion is not in the callback, then it will work before the request and arr[i] will be undefined.
If in a callback, then by the time the callback is called, a[i] will not be what you would like at all, and "foreign" data will be beaten.
In general, you can not do the same as yours.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question