coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 install => Topic started by: jimmyau on October 06, 2009, 03:13:33 AM

Title: There was an error while processing a database query
Post by: jimmyau on October 06, 2009, 03:13:33 AM
Hi

This is my second installation of CPG1.4.x

I have one running for almost 4 years (CPG1.4.18) without any porblems.

My second installations is reporting errors such as "There was an error while processing a database query".

I have searched the board and found related issues to the error message, but no resolution could help!

I switch on Debug mode and here is my findings:

There was an error while processing a database query
While executing query "SELECT * FROM cpg14x_pictures WHERE approved = 'YES' AND aid IN (1,2,3,4,5,7)  ORDER BY RAND() LIMIT -1" on 0

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1


I think this is to do with LIMIT -1 on the SQL query above.

The product is fresh install on the same server where CPG1.4.18 already running.


Any suggestiins from the forum / CPG support please

Thanks


NB:  DEBUG INFO FOLLOWS:





USER:
------------------
Array
(
    [ID] => 7bb562baba2ec3369d6d19598b9b28bb
    [am] => 1
    [lang] => english
    [liv] => Array
        (
           
Title: Re: There was an error while processing a database query
Post by: jimmyau on October 06, 2009, 03:18:47 AM
Sorry just forgot to highlight the new install version : it is CPG 1.4.25

Quote from: jimmyau on October 06, 2009, 03:13:33 AM
Hi

This is my second installation of CPG1.4.x

I have one running for almost 4 years (CPG1.4.18) without any porblems.

My second installations is reporting errors such as "There was an error while processing a database query".

I have searched the board and found related issues to the error message, but no resolution could help!

I switch on Debug mode and here is my findings:

There was an error while processing a database query
While executing query "SELECT * FROM cpg14x_pictures WHERE approved = 'YES' AND aid IN (1,2,3,4,5,7)  ORDER BY RAND() LIMIT -1" on 0

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1


I think this is to do with LIMIT -1 on the SQL query above.

The product is fresh install on the same server where CPG1.4.18 already running.


Any suggestiins from the forum / CPG support please

Thanks


NB:  DEBUG INFO FOLLOWS:





USER:
------------------
Array
(
    [ID] => 7bb562baba2ec3369d6d19598b9b28bb
    [am] => 1
    [lang] => english
    [liv] => Array
        (
           
  • => 93
                [1] => 197
                [2] => 192
                [3] => 195
                [4] => 96
            )

    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
        [user_id] => 0
        [user_name] => Guest
        [groups] => Array
            (
               
  • => 3
            )

        [group_quota] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 0
        [can_post_comments] => 0
        [can_upload_pictures] => 0
        [can_create_albums] => 0
        [pub_upl_need_approval] => 1
        [priv_upl_need_approval] => 1
        [upload_form_config] => 0
        [num_file_upload] => 5
        [num_URI_upload] => 3
        [custom_user_upload] => 0
        [disk_max] => 0
        [disk_min] => 0
        [ufc_max] => 0
        [ufc_min] => 0
        [has_admin_access] => 0
        [group_name] => Anonymous
        [can_see_all_albums] => 0
        [group_id] => 3
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM cpg14x_filetypes; (0s)
        [1] => select * from cpg14x_plugins order by priority asc; (0s)
        [2] => delete from `sirajdec_cpg25`.cpg14x_sessions where time<1254786410 and remember=0; (0s)
        [3] => delete from `sirajdec_cpg25`.cpg14x_sessions where time<1253580410; (0s)
        [4] => select user_id from `sirajdec_cpg25`.cpg14x_sessions where session_id = 'acb3053569288313d8c12b68253bd546' (0s)
        [5] => select user_id as id, user_password as password from `**masked**`.cpg14x_users where user_id=0 (0s)
        [6] => 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 cpg14x_usergroups WHERE group_id in (3) (0s)
        [7] => SELECT group_name FROM  cpg14x_usergroups WHERE group_id= 3 (0s)
        [8] => update `***MASKED***`.cpg14x_sessions set time='1254790010' where session_id = 'acb3053569288313d8c12b68253bd546' (0s)
        [9] => DELETE FROM cpg14x_banned WHERE expiry < '2009-10-06 11:46:50' (0s)
        [10] => SELECT * FROM cpg14x_banned WHERE (ip_addr='122.107.106.247' OR ip_addr='122.107.106.xxx' OR user_id=0) AND brute_force=0 (0s)
        [11] => SELECT aid FROM cpg14x_albums WHERE visibility != '0' AND visibility !='10000' AND visibility NOT IN (3) (0s)
        [12] => SELECT aid FROM cpg14x_albums (0s)
        [13] => SELECT aid from cpg14x_pictures WHERE pid='96' AND aid IN (1,2,3,4,5,7)  LIMIT 1 (0s)
        [14] => SELECT title,keyword from cpg14x_albums WHERE aid='5' (0s)
        [15] => SELECT COUNT(*) from cpg14x_pictures WHERE ((aid='5'  ) ) AND approved='YES' AND aid IN (1,2,3,4,5,7)  (0s)
        [16] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title, caption,hits,owner_id,owner_name from cpg14x_pictures WHERE ((aid='5'  ) ) AND approved='YES' AND aid IN (1,2,3,4,5,7)  ORDER BY position ASC  (0.001s)
        [17] => SELECT title,keyword from cpg14x_albums WHERE aid='5' (0s)
        [18] => SELECT COUNT(*) from cpg14x_pictures WHERE ((aid='5'  ) ) AND approved='YES' AND aid IN (1,2,3,4,5,7)  (0s)
        [19] => SELECT * from cpg14x_pictures WHERE ((aid='5'  ) ) AND approved='YES' AND aid IN (1,2,3,4,5,7)  ORDER BY position ASC  LIMIT 8 ,1 (0s)
        [20] => SELECT title, comments, votes, category, aid FROM cpg14x_albums WHERE aid='5' LIMIT 1 (0s)
        [21] => SELECT name, parent FROM cpg14x_categories WHERE cid = '2' (0s)
        [22] => UPDATE cpg14x_pictures SET hits=hits+1, lasthit_ip='122.107.106.xxx', mtime=CURRENT_TIMESTAMP WHERE pid='96' (0.001s)
        [23] => SELECT * FROM cpg14x_pictures WHERE approved = 'YES' AND aid IN (1,2,3,4,5,7)  ORDER BY RAND() LIMIT -1 (0s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
        [album] => random
        [cat] => 0
        [pos] => -96
    )

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

    ==========================
    Page generated in 0.026 seconds - 24 queries in 0.002 seconds - Album set : AND aid IN (1,2,3,4,5,7) ; Meta set: AND aid IN (1,2,3,4,5,7) ;




Title: Re: There was an error while processing a database query
Post by: Joachim Müller on October 06, 2009, 08:16:21 AM
Sure, whatever. Why don't you quote yourself once more, cluttering your posting even more. Board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270616.html#msg270616)
Title: Re: There was an error while processing a database query
Post by: jimmyau on October 06, 2009, 10:34:40 AM
Sorry, first time I use this forum.

Title: Re: There was an error while processing a database query
Post by: Joachim Müller on October 06, 2009, 10:57:24 AM
Instead of posting that you're sorry you could have done as suggested per board rules. There's a reason why I posted that link: I want you to read the page it leads to and do as suggested there.