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: Can't Delete File - error while processing a database query  (Read 3500 times)

0 Members and 1 Guest are viewing this topic.

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Can't Delete File - error while processing a database query
« on: September 27, 2007, 11:26:23 am »

Hi, I seem to have a problem with Deleting Files when logged in as Admin on the display image page. When I click delete file I get the following message: There was an error while processing a database query.

I have enabled debug mode and it tells me the following:

'While executing query "DELETE FROM  WHERE picture_id='11'" 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 'WHERE picture_id='11'' at line 1'

And...

Code: [Select]
USER:
------------------
Array
(
    [ID] => c3f0be2af431055489f9ac3bb62b90ce
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 16
            [1] => 14
            [2] => 15
            [3] => 10
            [4] => 13
        )

    [search] => Array
        (
            [search] => test
            [album] => search
            [title] => 1
            [caption] => 1
            [keywords] => 1
            [owner_name] => 1
            [filename] => 1
            [type] => AND
            [x] => 19
            [y] => 27
            [params] => Array
                (
                    [title] => 1
                    [caption] => 1
                    [keywords] => 1
                    [owner_name] => 1
                    [filename] => 1
                )

        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => inkadmin
    [groups] => Array
        (
            [0] => 1
        )

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

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg1411_filetypes; (0s)
    [1] => select * from cpg1411_plugins order by priority asc; (0s)
    [2] => delete from `inkanarc_ink`.cpg1411_sessions where time<1190881217 and remember=0; (0s)
    [3] => delete from `inkanarc_ink`.cpg1411_sessions where time<1189675217; (0s)
    [4] => select user_id from `inkanarc_ink`.cpg1411_sessions where session_id=md5("b53e128832a352259353dc16976032234bcec2e2bf502cd6bb00183ec4108bca"); (0s)
    [5] => select user_id as id, user_password as password from `inkanarc_ink`.cpg1411_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.avatar_url AS avatar_url, u.enable_admin_email AS notify, u.auto_subscribe_post AS auto_subscribe_post, u.auto_subscribe_comment AS auto_subscribe_comment, u.user_group+100 AS group_id FROM `inkanarc_ink`.cpg1411_users AS u INNER JOIN `inkanarc_ink`.cpg1411_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `inkanarc_ink`.cpg1411_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => 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 cpg1411_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg1411_usergroups WHERE group_id= 1 (0s)
    [10] => update `inkanarc_ink`.cpg1411_sessions set time='1190884817' where session_id=md5('b53e128832a352259353dc16976032234bcec2e2bf502cd6bb00183ec4108bca'); (0s)
    [11] => SELECT user_favpics FROM cpg1411_favpics WHERE user_id = 1 (0s)
    [12] => SELECT home,login,my_gallery,upload_pic,album_list,lastup,lastcom,topn,toprated,favpics,search,my_profile FROM cpg1411_final_extract_config WHERE Group_Id=1 (0s)
    [13] => DELETE FROM cpg1411_banned WHERE expiry < '2007-09-27 10:20:18' (0s)
    [14] => SELECT * FROM cpg1411_banned WHERE (ip_addr='86.146.188.221' OR ip_addr='86.146.188.221' OR user_id=1) AND brute_force=0 (0s)
    [15] => SELECT COUNT(*) FROM cpg1411_pictures WHERE approved = 'NO' (0s)
    [16] => SELECT aid, filepath, filename FROM cpg1411_pictures WHERE pid='11' (0s)
    [17] => DELETE FROM cpg1411_comments WHERE pid='11' (0s)
    [18] => DELETE FROM  WHERE picture_id='11' (0s)
)

==========================
GET :
------------------
Array
(
    [id] => 11
    [what] => picture
)

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

==========================
VERSION INFO :
------------------
PHP version: 4.4.4 - OK
------------------
mySQL version: 4.1.22-standard
------------------
Coppermine version: 1.4.12(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.28 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 4.1.22
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.1.2
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 | dl | dl
file_uploads | On | On
include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
open_basedir | no value | 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 | 10M | 10M
post_max_size | 8M | 8M
==========================
Page generated in 0.073 seconds - 19 queries in 0 seconds - Album set : ; Meta set: ;

The button does delete the image file itself, but not the page nor thumbnail. I can delete okay from the admin manager, but need this to work too?

Any ideas much appreciated.
« Last Edit: September 27, 2007, 02:58:59 pm by Hein »
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Can't Delete File - error while processing a database query
« Reply #1 on: September 27, 2007, 11:42:04 am »

Update first to 1.4.13, you are currently running 1.4.12
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: Can't Delete File - error while processing a database query
« Reply #2 on: September 27, 2007, 11:59:34 am »

Will do.
I only installed about three weeks ago - didn't know it had updated.

Is that going to solve this issue you tihnk?
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: Can't Delete File - error while processing a database query
« Reply #3 on: September 27, 2007, 02:53:18 pm »

 ;D top marks. its fixed it.

Just need to fix the profile image now as thats packed up with the update  ::)

Many thanks for the heads up.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Can't Delete File - error while processing a database query
« Reply #4 on: September 27, 2007, 02:59:20 pm »

Thanks for reporting back. Marking thread as solved. Have fun using cpg!
Logged

chris.h

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 38
    • Zookx Design
Re: Can't Delete File - error while processing a database query
« Reply #5 on: September 27, 2007, 03:31:14 pm »

Yep. Also to sort the profile image loss, had to update the mod pack, http://forum.coppermine-gallery.net/index.php?topic=47041.0, new to this so didn't klnow thet would need updating too.

Cheers.  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.051 seconds with 20 queries.