I require_once("includefile.php"); that contains a mysql_connect() function that returns a valid Resource ID.
$OneSitHomeDB = mysql_connect($hostname_OneSitHomeDB, $username_OneSitHomeDB, $password_OneSitHomeDB) or die(mysql_error());
I have a mysql_select_db() of:
mysql_select_db($database_OneSitHomeDB, $OneSitHomeDB) or die(mysql_error() . " mysql_select_db($database_OneSitHomeDB, $OneSitHomeDB) " . __FILE__ . " : " . __LINE__);
Note that the call and arguments are printed as part of the die() function. What is returned is:
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\Inetpub\wwwroot\OnesitHome\php-includes_autoCache.php on line 56
mysql_select_db(1sitHomeDB, Resource id #4) c:\Inetpub\wwwroot\OnesitHome\php-includes_autoCache.php : 56
As you can see from the output, the Resource ID is 'Resource id #4' which sure looks like a valid resource ID to me! I've tried restarting mySQL, restarting the webservice, etc. This same code has worked reliably (same function) in another application. But I can't figure out what's wrong or how to solve it.
It seems to magically start working sometimes and then dies again from this error. But I can't go forward with the error.
I have noticed that the page that uses this will sometimes have an "transferring data from pdx1" in the satus bar (which it doesn't seem like it should since the page is complete) so I'm not sure if that has anything to do with it. When I look at the connections in mysqlAdministrator it usually shows 2 but never more than 4.