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: database error after php include  (Read 4202 times)

0 Members and 1 Guest are viewing this topic.

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
database error after php include
« on: June 23, 2005, 06:53:51 pm »

Good morning fellow Coppermine lovers...

After following the strict guidlines set forth here: http://forum.coppermine-gallery.net/index.php?topic=9863.0  I am getting a bizzare database querry error that I cannot figure out. I ran it in debug mode and got the following:

There was an error while processing a database query.
Code: [Select]
While executing query "SELECT count(*) FROM cpg133_albums as a WHERE category = '0'" on 0

mySQL error: Table 'ads.cpg133_albums' doesn't exist

Code: [Select]
File: /home/httpd/vhosts/myspecialdog.com/httpdocs/spotlight/include/functions.inc.php - Line: 105
Code: [Select]
USER:
------------------
Array
(
    [ID] => 0549c3394d3291e7642dbd5224e27792
    [am] => 1
    [liv] => Array
        (
            [0] => 1
        )

    [name] => joe
)

==========================
USER DATA:
------------------
Array
(
    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 0
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrator
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
    [groups] => Array
        (
            [0] => 1
            [1] => 4
        )

)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content FROM cpg133_filetypes;
    [1] =>
SELECT variable, value
FROM smf_settings
    [2] =>
SELECT mem.*, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH
FROM smf_members AS mem
LEFT JOIN smf_attachments AS a ON (a.ID_MEMBER = 1)
WHERE mem.ID_MEMBER = 1
LIMIT 1
    [3] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (1,4)
    [4] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 1
    [5] => DELETE FROM cpg133_banned WHERE expiry < '2005-06-23 09:46:45'
    [6] => SELECT * FROM cpg133_banned WHERE ip_addr='24.249.152.80' OR ip_addr='24.249.152.80' OR user_id=1
    [7] => SELECT cid, name, description, thumb FROM cpg133_categories WHERE parent = ''  ORDER BY pos
    [8] => SELECT aid FROM cpg133_albums as a WHERE category>=10000
    [9] => SELECT count(*) FROM cpg133_pictures as p, cpg133_albums as a WHERE p.aid = a.aid AND category >= 10000
    [10] => SELECT cid, name, description, thumb FROM cpg133_categories WHERE parent = '1'  ORDER BY pos
    [11] => SELECT aid FROM cpg133_albums as a WHERE category = '0'
    [12] => SELECT count(*) FROM cpg133_albums as a WHERE 1
    [13] => SELECT count(*) FROM cpg133_pictures as p LEFT JOIN cpg133_albums as a ON a.aid=p.aid WHERE 1
    [14] => SELECT count(*) FROM cpg133_comments as c LEFT JOIN cpg133_pictures as p ON c.pid=p.pid LEFT JOIN cpg133_albums as a ON a.aid=p.aid WHERE 1
    [15] => SELECT count(*) FROM cpg133_categories WHERE 1
    [16] => SELECT sum(hits) FROM cpg133_pictures as p LEFT JOIN cpg133_albums as a ON p.aid=a.aid WHERE 1
    [17] => SELECT count(*) FROM cpg133_albums as a WHERE category = '0'
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.10 - OK
------------------
mySQL version: 3.23.58
------------------
Coppermine version: 1.3.3
==========================
Module: gd
------------------
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
==========================
Module: mysql
------------------
Active Persistent Links 1
Active Links 1
Client API version 3.23.58
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.1.1
Linked Version 1.2.1.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | Off | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/share/pear | .:/usr/share/pear
open_basedir | /home/httpd/vhosts/myspecialdog.com/httpdocs:/tmp | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.063 seconds - 18 queries in 0.004 seconds - Album set :

The header I included has a reference to my ads database where its pulling our ads from... it seems that coppermine is putting the database prefix "ads." before searching... This is a bit over my head... Any comments, criticism, help, barratement you could throw my way would be appreciated.

Kevin
Logged

Nibbler

  • Guest
Re: database error after php include
« Reply #1 on: June 23, 2005, 06:57:55 pm »

You need to add a call to mysql_select_db('your coppermine db name here'); after the ads are run to tell php to switch back to the coppermine database.
Logged

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: database error after php include
« Reply #2 on: June 23, 2005, 08:38:34 pm »

I tried inserting the line: 
Code: [Select]
mysql_select_db('forum'); (forum is the name of the database since I have it sinced with SMF) after the string of code calling my custom pageheader but received the same results... please pardon my ignorance in code writing.
Logged

Nibbler

  • Guest
Re: database error after php include
« Reply #3 on: June 23, 2005, 09:04:34 pm »

Can you move the ad script into the same database as coppermine/smf ?
Logged

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: database error after php include
« Reply #4 on: June 23, 2005, 10:21:59 pm »

not easily... do I have to?
Logged

Nibbler

  • Guest
Re: database error after php include
« Reply #5 on: June 23, 2005, 10:23:49 pm »

Well you can either move it or handle the db connections better in the code. If you can attach your theme.php to your next post then I can take a look at it.
Logged

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: database error after php include
« Reply #6 on: June 23, 2005, 10:53:07 pm »

I moved it and it works fine now... my only concern is that I now have three potentially VERY large databases (forum, ads, and coppermine) running from within one database. Do you see any problems with that?
Logged

Nibbler

  • Guest
Re: database error after php include
« Reply #7 on: June 24, 2005, 01:22:03 pm »

Probably not, but if/when you upgrade to 1.4 upon release you will be able to have the forum and gallery in different databases.
Logged

kroberson

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: database error after php include
« Reply #8 on: June 25, 2005, 01:54:36 am »

How could I go about getting 1.4 now? Im antsie for it...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.