Welcome to WebmasterWorld Guest from 54.198.222.129

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Data base connections

i need some advise

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

10+ Year Member



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?
3:33 am on Jun 25, 2004 (gmt 0)

10+ Year Member



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.

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

10+ Year Member



thanx for the advise :)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month