In php how to do session instances?
<p>I'm quite new on php and am trying to learn it.</p>

<p>My question is rather simple but I've been a bit lost while googling for it.</p>

<p>I just want to create an object to manage the database connection. I already did the object and now the problem I'm facing is:</p>

<p>How do i keep it instanced to a session? (So that i don't need to open/close the connection to the database on every page load) And how do I call it afterward?</p>

<p>Are there any way to declare a destroyer, so that when the instance is dying, the connection to the database gets closed?</p>
