You are here: Re: How often do I need to connect to MySQL database? « PHP Programming Language « IT news, forums, messages
Re: How often do I need to connect to MySQL database?

Posted by peter on 03/13/07 19:56

> At present at the top of each of my php pages I reconnect to my
> database
>
> mysql_connect(...);
>
> is that actually necessary/good practice. Isn't there something about
> persistent connections.

instead of connecting on each php page you should put your connection
details in a seperate file and use require_once() to call it.

This will make it easier to change and also will defend against connecting
to the database more than once accidentally.

 

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

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