Jump to content

Archived

This topic is now archived and is closed to further replies.

thegraingers

mysql connect/close

Recommended Posts

I assume you mean [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=82506\" target=\"_blank\"]this topic[/a], but there's no post there!?!?

Share this post


Link to post
Share on other sites

[!--quoteo(post=332901:date=Jan 3 2006, 09:42 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 3 2006, 09:42 PM) 332901[/snapback][/div][div class=\'quotemain\'][!--quotec--]

I assume you mean [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=82506\" target=\"_blank\"]this topic[/a], but there's no post there!?!?

 

 

 

whooooops, so any answers to my question.............

Share this post


Link to post
Share on other sites

my question, which appears to have been lost is

 

Is it better on a web page to open a mysql connection at the start of the page, do a number of queries and then close the database connection

 

OR

 

if it is possible to split the queries up would it be better to do a number of open, query, close operations.

 

 

a typical page might look like this

query for advert selection

query to log advert shown

 

query for another advert

query to log advert

 

query to populate part of a side menu

query for a poll in side menu

 

query for page content

 

query for another advert

query to log advert

 

etc

Share this post


Link to post
Share on other sites

Don't re-connect multiple times... too much overhead. Once per page is always the right way to go.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.