How to close the connection with mysql a looped script?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
8 views
I use RabbitMQ. He has sorcery where there are different queries to the database. And I have piling up the connection to the database, since they are not closed (the script is not completed, and waits for new messages).

Question: what are the correct ways of closing connections?

I see:
1. Or register close the connection after saving the message.
2. Or not to close (but it eats a lot of resources)
3. Or is there something else.
by | 8 views

1 Answer

0 like 0 dislike
It may not be necessary every time to open a connection when receiving a task and will not accumulate?
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
35,595 users