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 the recent error, “too many connections” (“PHP Warning: mysql_connect () [function.mysql-connect]: Too many connections”), and I wonder if using include () created more connections than necessary.
include_once('my_db_connect.php');
instead
include('my_db_connect.php');
source
share