V
V
Vyacheslav Grachunov2016-07-24 17:32:50
MySQL
Vyacheslav Grachunov, 2016-07-24 17:32:50

How to close connection after all MySQL queries are done?

In short, this is how my script sends many requests to insert data into MySQL - you need to understand when all requests will pass and close the connection.
In this case, everything is performed not by sequential requests, but in a loop with a bunch of nested forEach (parser). How to be? It is necessary that the script ends, and does not hang, because. its constant restart is required upon completion
Yes, Node.js
It was in the tags - I didn’t write in the text

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
IceJOKER, 2016-07-24
@IceJOKER

А читать документацию ?
fi2.php.net/manual/en/mysqli.close.php

Виталий, 2016-07-24
@vshvydky

обернуть скуль запросы в промис, в then выполнить закрытие базы (ровно как и в catch на крайний пожарный)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question