I\'m nothing like a php developer but I do have to use it and I\'m not really aware on how PHP handle memory allocation during session.
I\'m working on an applica
Never create a new connection for every query; You don't even have to close it manually.
Just create the connection at the beginning of you page
have a look at: How do you efficiently connect to mysql in php without reconnecting on every query
you can use this:
public function __destruct()
{
mysql_close($this->connection);
}
it will get called when the page is closed
From PHP's Mysqli documentation:
a connection between a client process and a database can be reused by a client process, rather than being created and destroyed multiple times. This reduces the overhead...