User Defined Tag and MySQL
Posted: Thu Aug 31, 2006 9:19 pm
I've seen some other posts on this, but I'm not totally sure I understand.
In my PHP code, I need to access a different database. So I have this code:
$username="calvary";
$password="XXXXXXXX";
$database="calvarydb";
$server="localhost";
$mylink = mysql_connect($server,$username,$password);
$db_selected = mysql_select_db($database);
if (!$db_selected) {
die( "Unable to select database");
}
.
blah
.
mysql_close($mylink);
For some reason, that mysql_close is closing the CMS database link?
I know if I leave mysql_close off, it fixes things, but that seems wrong.
Any suggestions would be appreciated.
I have seen other comments about reusing the database connection, but this is to a totally different database?
BTW, CMSMS is totally awesome. I'm loving this.
Mike Kaply
In my PHP code, I need to access a different database. So I have this code:
$username="calvary";
$password="XXXXXXXX";
$database="calvarydb";
$server="localhost";
$mylink = mysql_connect($server,$username,$password);
$db_selected = mysql_select_db($database);
if (!$db_selected) {
die( "Unable to select database");
}
.
blah
.
mysql_close($mylink);
For some reason, that mysql_close is closing the CMS database link?
I know if I leave mysql_close off, it fixes things, but that seems wrong.
Any suggestions would be appreciated.
I have seen other comments about reusing the database connection, but this is to a totally different database?
BTW, CMSMS is totally awesome. I'm loving this.
Mike Kaply