pro_php thread: SV: RE: Easy question...
To add yet another opinion, it does no harm to keep the connect() call in the
function.
If a database function requires a database connection, then you should, for
validity's sake, call connect() in every function that makes some query to the
database.
If there is already a connection established, connect() will just return the
existing connection id anyway.
You can only assume that the connection exists if (and only if) you've
performed validity checks on the result from the original call to connect().
For example:
$DB_LINK = connect();
if(!$DB_LINK)
{
Header('db_problems.html');
}
// rest of script here.
Take care,
Nik