coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Syntax on October 13, 2004, 05:41:15 AM

Title: Wrong Database or No Database
Post by: Syntax on October 13, 2004, 05:41:15 AM
Ive included the script into a site design... and theres another script running on the same webpage.
The first script logs into the sql server and selects a db named accountr_database1, then
I have coppermine included which logs into the same sql server and uses a database named account_coppermine
coppermine then says

Critical Error
There was an error while processing a database query.
mySQL error: Table 'account_database1.cpg132_albums' doesn't exist

As you can see from the above debug mode it was trying to pull a table from _database1 instead of the _coppermine database.
So I added a mysql_close() to my first script.  Now coppermine says

Critical Error
There was an error while processing a database query.
mySQL error: No Database Selected

Whats the deal? It has its own database, and its set to select it in the config..
yet it tries to select the other one, that is already open, and if I close it, it dosnt even open its own..

Title: Re: Wrong Database or No Database
Post by: Joachim Müller on October 13, 2004, 07:44:54 AM
coppermine usuallly can't be included via the php constructs "require" or "include". This is by design and can't be changed that easily.

Joachim
Title: Re: Wrong Database or No Database
Post by: Syntax on October 13, 2004, 08:26:15 AM
Ive used it like this many times before.. just not this version...
and... Its not being included, the gallery is including my header footer and menu which include other scripts..
I ripped all the header and footer from the template
and then added include('/header.php'); and footer and menu inside
the theme.php under the sections where it generates the header and footer of the page.

works great.. just wrong database..
Title: Re: Wrong Database or No Database
Post by: Nibbler on October 13, 2004, 01:18:23 PM
Add a mysql_select_db($CONFIG['dbname']) in there after the other scripts are finished,