You are here: Efficiency of mysql_close() « PHP Programming Language « IT news, forums, messages
Efficiency of mysql_close()

Posted by huckphin on 06/04/07 16:23

Hello,

I am working on a script for PHP that handles mysql_connections.
Right now, each time I query the database, i open the connection using
mysql_connect(), and after I get my resource result, I use
mysql_close(). I have heard from many people that it is common
practice to open a connection at the beginning of the script, and
since the connection closes at the end of the script, it is then
closed.

My question is this: Which is the better way? To open the script
at the top, and then let the connection close at the bottom? As this
may be a controversial issue, and if no answer is found, what are the
advantages?

Does anyone know if the resources used, and the time elapsed to make
a db connection is significant enough to warrant leaving the
connection open the entire time?

What are the advantages?

Thank you.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация