Author Topic: An unexpected error occured. Please try again later  (Read 360355 times)

0 Members and 1 Guest are viewing this topic.

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #30 on: February 18, 2010, 08:12:20 PM »
Hello,

I'm having the same error message and cannot decipher it.

I followed the instructions in the first post and received this:


An unexpected error occured. Please try again later.

Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name
            FROM (4images_images i,  4images_categories c)
            LEFT JOIN 4images_users u ON (u.user_id = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ((0, 18, 21, 22, 29, 41, 23, 28, 30, 24, 31, 36, 17, 25, 32, 37, 19, 26, 33, 38, 20, 27, 34, 39, 35, 40), 37) AND c.cat_id = i.cat_id
            LIMIT 256, 1
Operand should contain 1 column(s)


I do not know where to go from here and would be SO grateful for some help on how to make the error message disappear.  Thank you!

Rembrandt

  • Guest
Re: An unexpected error occured. Please try again later
« Reply #31 on: February 18, 2010, 08:23:54 PM »
Welcom to the Forum!

  WHERE i.image_active = 1 AND i.cat_id NOT IN ((0, 18, 21, 22, 29, 41, 23, 28, 30, 24, 31, 36, 17, 25, 32, 37, 19, 26, 33, 38, 20, 27, 34, 39, 35, 40), 37) ...

i think the error come from  "40), 37)"

mfg Andi

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #32 on: February 18, 2010, 08:46:34 PM »
Thank you very much for your quick reply!

How do I go about fixing that?  I'm very much a novice at this, so any directions would be very much appreciated.

Rembrandt

  • Guest
Re: An unexpected error occured. Please try again later
« Reply #33 on: February 18, 2010, 08:55:44 PM »
post the corrupt sql query here.

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #34 on: February 18, 2010, 09:15:02 PM »
is this what you mean?


An unexpected error occured. Please try again later.

Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name
            FROM (4images_images i,  4images_categories c)
            LEFT JOIN 4images_users u ON (u.user_id = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ((0, 18, 21, 22, 29, 41, 23, 28, 30, 24, 31, 36, 17, 25, 32, 37, 19, 26, 33, 38, 20, 27, 34, 39, 35, 40), 37) AND c.cat_id = i.cat_id
            LIMIT 256, 1
Operand should contain 1 column(s)

Rembrandt

  • Guest
Re: An unexpected error occured. Please try again later
« Reply #35 on: February 18, 2010, 09:17:52 PM »
i mean the php code

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #36 on: February 18, 2010, 09:24:12 PM »
I'm so sorry... I wasn't lying when I said I am REALLY a novice at this. LOL
I can paste the .php code here.  From which file?  There appear to be several.   :oops:

Rembrandt

  • Guest
Re: An unexpected error occured. Please try again later
« Reply #37 on: February 18, 2010, 09:24:54 PM »
you have made a modification?
 make them undo

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #38 on: February 18, 2010, 11:10:13 PM »
i haven't modified anything.  the error code was already there.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: An unexpected error occured. Please try again later
« Reply #39 on: February 19, 2010, 12:26:53 AM »
Ok, then let me ask you this:
1) Did you just install the gallery and that error showed right the way? - I doubt it.
2) Where (what page) exactly this error shows?
3) What did you do before the error started showing?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #40 on: February 19, 2010, 12:44:03 AM »
Hi V@no.  Thanks for trying to help me.

1.  I had the previous version of 4images installed and did not have the error message.  I upgraded to the most current version and then I noticed the error message.  The only things I did in between were add some categories and upload images.  I did not change anything within the coding, itself.  I ended up uninstalling and reinstalling the gallery from scratch into a new database.  The error message returned.

2.  This error shows on every page if the user is NOT logged in.  It disappears if the person is registered and logged in.  But I would like people to be able to view certain categories without needing to be a registered user.

3.  See #1.

Thank you!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: An unexpected error occured. Please try again later
« Reply #41 on: February 19, 2010, 01:03:17 AM »
I suspect the error comes from random image code. To confirm/deny that, try to disable random image via includes/constants.php:
define('SHOW_RANDOM_IMAGE'0);
define('SHOW_RANDOM_CAT_IMAGE'0);
(these two lines are already there, change 1 to 0

If error is gone, then show block of code from includes/functions.php between
function get_random_image_cache() {
and
function format_file_size($file_size 0) {
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #42 on: February 19, 2010, 01:21:09 AM »
V@no, you were right.  I spoke to the other person with admin rights who tried to make a category invisible from random image by modifying the functions.php file.  I did not know she had done this.  I just restored it with the original file and the error message went away.  Thank you very much!

Now I need to go find a way to make a category invisible... because what she did, did not work.

I really appreciate all of the help!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: An unexpected error occured. Please try again later
« Reply #43 on: February 19, 2010, 01:55:46 AM »
in global.php find:
  $cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN");

Replace it with:
  $cat_id_sql get_auth_cat_sql("auth_viewcat""NOTIN") . ",37";

(assuming the category ID you are trying to hide is 37)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sandramichelle

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: An unexpected error occured. Please try again later
« Reply #44 on: February 19, 2010, 03:40:11 PM »
Thanks, V@no!  Everything is working perfectly.  You guys are great!