MYSQL - number of rows returned equals number of connections?
A connection survives until one of these:


You explicitly call disconnect(), or
Your program terminates, or
A network glitch causes the disconnect.


Normally, you should code your app to connect once near the beginning and disconnect when finished.  (There are rare use cases for having multiple connections open at once.)

Most APIs have an obscure setting that determines whether you get all the rows (of a SELECT) in one "round trip" to the server, or whether they are fed to you individually (maybe in small chunks??) in many round trips.  There are advantages and disadvantages of either.  99.9% of the time, I am happy getting the entire resultset on one round trip, even if it is 100K rows.