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]
|