connectionscentres
Programmer
I have a small site of about 66 pages using php and mysql to offer various database driver services.
On each page where a database connection is required I have a php include directive at the top of the page. This includes a file where I make a single (non persistent) database connection each time.
However, I have just come accross the require_once directive. I am thinking that if I used this in conjunction with a persistent database connection I could merely invoke this when a user logs on and then forget about it for the remainder of the pages.
Does anyone have any suggestions from past experience as to whether this method is better?
On each page where a database connection is required I have a php include directive at the top of the page. This includes a file where I make a single (non persistent) database connection each time.
However, I have just come accross the require_once directive. I am thinking that if I used this in conjunction with a persistent database connection I could merely invoke this when a user logs on and then forget about it for the remainder of the pages.
Does anyone have any suggestions from past experience as to whether this method is better?