I originally asked this on another forum, but I've either worn out my welcome, or I've stumped them all.
I created a script that uses a mysql connection, and it's intended to be inserted as a block in other scripts. I'm attempting to insert it into a forum system, but it's breaking the mysql connection of the forum script when I try to use it. The db connection is made in a config file, and it's called by the block script.
forum db is roughing_forum
my script is roughing_automonial
db client is the same for both
The connection string for my script(config.php):
$autoconn = mysql_connect("$dhost","$dusername","$dpwd") or die ("Unable to connect to database."); $dbi=mysql_select_db($dbname,$autoconn) or die("Unable to make master connection to database from the config file!" . mysql_error());
When I insert the script into the forum via include, I get an error that shows me that the forum is now trying to use my script's db for data:
Fatal error: Database error: 1146: Table 'roughing_automonial.v_pm' doesn't exist - File: /home/roughing/public_html/templates/1/header.html(54) : eval()'d code on line 26 in /home/roughing/public_html/classes/database/mysql.inc.php on line 291
So I added the following to the very last line of my block script:
With this setup, the error I receive makes it look like my script has now shut down all mysql connections:
Fatal error: Database error: : - File: /home/roughing/public_html/templates/1/header.html(54) : eval()'d code on line 26 in /home/roughing/public_html/classes/database/mysql.inc.php on line 291
I don't know what else to do. I tried
$autoconn = null;
but that put me back to the first error.
Any help in solving this would be greatly appreciated.