2 Replies - 560 Views - Last Post: 09 April 2018 - 01:14 AM Rate Topic: -----

#1 gussy81   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 175
  • Joined: 24-February 15

Closing DB connections

Posted 09 April 2018 - 12:47 AM

Hi,

I have a login page that connects to a table of users. My question is when should i close the connection to the DB? When the user logs in i present them with a list of options of where to navigate to next and they are then able to view pages that also pull from different tables.

Should i close the connection to database after they log in and open again when querying the database?

thanks
G
Is This A Good Question/Topic? 0
  • +

Replies To: Closing DB connections

#2 maceysoftware   User is offline

  • Foo
  • member icon

Reputation: 367
  • View blog
  • Posts: 1,573
  • Joined: 07-September 13

Re: Closing DB connections

Posted 09 April 2018 - 01:12 AM

I tend to open the connection, do whatever I need to do and close the connection, while attempting to keep the connection open for the smallest amount of time, through code at least.
Was This Post Helpful? 1
  • +
  • -

#3 gussy81   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 175
  • Joined: 24-February 15

Re: Closing DB connections

Posted 09 April 2018 - 01:14 AM

ok thanks for advice

regards
G
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1