homepage Welcome to WebmasterWorld Guest from 107.21.135.68
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Data base connections
i need some advise
guzzi




msg:1312352
 9:44 pm on Jun 24, 2004 (gmt 0)

i just want to know what is safer when developing a site, opening and closing a connection to a database only when it is needed or leaving the connection open for the duration of the usage to improve the speed of the site. if it is better to open and close the database connection all the time is safe to put the code into a include page as an object that can be created everytime the connection is used, with methods to open and close the connection?

 

m_shroom




msg:1312353
 3:33 am on Jun 25, 2004 (gmt 0)

Use an include page for you db conection script and make it a php script (a php script with no print or echo statments will never be displayed by a browser).

Connecting to the db involoves opening a socket (which is more or less a secure connection).

But even with pconnect your connection is droped when the script page ends.

guzzi




msg:1312354
 6:23 pm on Jun 25, 2004 (gmt 0)

thanx for the advise :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved