General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 16th, 2003, 07:59 PM
tim tim is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 62 tim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 9 sec
Reputation Power: 7
Send a message via ICQ to tim
Closing/Opening Connection OBjects

I have the following lines of codes

GetLanguage();

GetPrivilege();

GetLogonuser();

include("includes/db_connect.php");

.
.
.
My remaining php codes and html content below
.
.
.

Inside of my first 3 functions, I open/created a connection object to the database, do the designated job, closed connection and get out. Hence, looks like i am creating/closing the conn object 6 times. THen, I open another connection in my include statement and use this as my connection object for the rest of the php codes after it.

Is this efficient. Will there be noticeable slow down in performance. Or should I just put the includes statement right at the top, and have each of the function global the conn object in?

btw, using Postgres.
__________________
Beginner

Reply With Quote
  #2  
Old February 16th, 2003, 09:22 PM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
I don't have any concrete examples for proof of concept, however, I've definately found that when using a connection more than twice in the same script it is more effecient to keep a persistent connection open then just allow the ending of the script to automatically close the connection which is the default.

--
Wil Moore III
www.wilmoore.com
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Closing/Opening Connection OBjects


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT