Im pretty sure PHP closes any open connections at the end of your page.
Also, in regards to your queyr:
SELECT * FROM table;
Thats asking mysql to return back ALL columns of ALL rows.
If there are 1000 rows in your database, mysql is sending 1000 rows worth of data back to the page each time its loaded.
If you only require a specific number of rows, or only access specific fields, you should alter your query:
SELECT id, name FROM table LIMIT 5
For example.