iam using 3 different databases for my project.
it contain same password and user name. the code is
$con = mysql_pconnect(hostname, username, password) or die("Connection Error: " . mysql_error());
mysql_select_db(database_name, $con) or die("Error connecting to DB. " . mysql_error());
$con1 = mysql_pconnect(hostname, username, password) or die("Connection Error: " . mysql_error());
mysql_select_db(database_name, $con) or die("Error connecting to DB. " . mysql_error());
$con2 = mysql_pconnect(hostname, username, password) or die("Connection Error: " . mysql_error());
mysql_select_db(database_name, $con) or die("Error connecting to DB. " . mysql_error());
three database not connected properly.
It looks like you are possibly missing either
$in front of variables for the connection strings:Or you need to be sure tn use quotes around the entries.
On that note though, you should probably be using PDO to connect to databases if you are writing fresh code.
Edit: Also, even though you are making new connections, you do keep using the first
$conyou define in themysql_select_dbstatements (all use$conrather than$con1,$con2).