I have an include file for my database connections that has the following code:
$my_db_link = mysql_connect('my_host', 'my_username', 'my_password');
if (!$my_db_link) {
die('Could not connect: ' . mysql_error());
}
$my_db_name = 'my_database';
mysql_select_db($my_db_name);
Will it make a difference if I use include_once() rather than include(), or require_once() rather than require()? We had a recent "too many connections" error ("PHP Warning: mysql_connect() [function.mysql-connect]: Too many connections ") and I'm wondering if using include() created more connections than necessary.
include_once('my_db_connect.php');
instead of
include('my_db_connect.php');