Menu
If I have some classes that represent objects in a database, is it better to have a call to mysql_connect() and mysql_select_db() and then mysql_close() in only the functions that require access to the database, or is it better to just have one call to mysql_connect() and mysql_select_db() in a configuration script and require_once() that script at the top of every class, keeping the connection open throughout every script until the page is finished?