PHP script bağlantıyı kapatmak için bir zorunluluktur?
DB sunucu yapılandırmasına bağlı olarak, aynı zamanda bunun için açılan bağlantıların olası sayısında bir sınır yoktur.
Yani, komut ise:
Bu, tüm sorguları yaptıktan sonra bağlantıyı kapatmak için ilginç olabilir - ve gerekli hale olduğunda, sadece bağlantı açmak.
Still, note that connections are closed when the script ends, anyway ; which means that if you don't have a wya to be sure that you have finished doing queries, you don't need to close the connection : keeping it opened allows you to do some additionnal queries whenever it's necessary.
(This is particularly true is your pages are built using several distinct and independant components, that are all susceptible to do DB queries)
For the applications I write, I generally :