I have a database class that uses PDO prepared statements. The connection is like this:
public function dbConnect() {
$this->_dbh = new PDO('mysql:host=localhost; dbname=db_name', 'username', 'password');
}
I have a few questions about it.
1. Should I put this code in my constructor method?
2. Should I set $dbh = null; at the end of the script or leave it open?
This application will be hammering this class with queries non-stop,
it's the crux of the website, looking up products in a catalog.