connecting each time

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
matt1234
Forum Commoner
Posts: 44
Joined: Wed Nov 26, 2008 9:43 pm

connecting each time

Post by matt1234 »

I have this page on my site which is included() with every page of my site. it can possibly look one way based on a variable at different times. Right now, I have started putting those variables in php right on the page but I also have the stuff in a database. Is it a bad idea to have that page open my sql database every time it's loaded? Also, does that cut down on speed significantly?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: connecting each time

Post by califdon »

matt1234 wrote:I have this page on my site which is included() with every page of my site. it can possibly look one way based on a variable at different times. Right now, I have started putting those variables in php right on the page but I also have the stuff in a database. Is it a bad idea to have that page open my sql database every time it's loaded? Also, does that cut down on speed significantly?
No, you'll never notice any difference. If you were getting as many hits per second as Amazon or Google, possibly you could measure the time it would take to connect, but for 99.99% of web sites, it will be so small it is insignificant. That's what it's designed to do.
Post Reply