Page 1 of 1
connecting each time
Posted: Mon Dec 22, 2008 6:20 pm
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?
Re: connecting each time
Posted: Mon Dec 22, 2008 7:13 pm
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.