Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Wrong Database or No Database  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

Syntax

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Wrong Database or No Database
« 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..

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Wrong Database or No Database
« Reply #1 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
Logged

Syntax

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Wrong Database or No Database
« Reply #2 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..
Logged

Nibbler

  • Guest
Re: Wrong Database or No Database
« Reply #3 on: October 13, 2004, 01:18:23 pm »

Add a mysql_select_db($CONFIG['dbname']) in there after the other scripts are finished,
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 15 queries.