Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 159
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 151
Total: 151

Author Topic: Database Error on the Gallery - No comments visible  (Read 6229 times)

0 Members and 1 Guest are viewing this topic.

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Database Error on the Gallery - No comments visible
« on: November 20, 2012, 03:14:41 am »
I'm having a database error on the Gallery where no comments and the quick comment are visible. This is the error I'm having:

Quote
http://themobilephotographyblog.com/index.php?pretty;action=gallery&sa=view;id=144
Database Error: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
File: /home/sites/themobilephotographyblog.com/public_html/Sources/Load.php(2269) : eval()'d code
Line: 2671

I have no idea what originated this and I don't have also no idea on how to fix it.

You can see the error here: http://themobilephotographyblog.com/gallery/?sa=view;id=492

Edit: I added my Load.php file.
« Last Edit: November 20, 2012, 03:35:35 am by Jonas1975 »

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #1 on: November 20, 2012, 03:46:34 am »
Seems like this is on hosting server side.

Found out this: http://drupal.org/node/359702 but I haven't enough php language knowledge to understand it completely.
« Last Edit: November 20, 2012, 03:48:24 am by Jonas1975 »

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #2 on: November 20, 2012, 10:07:47 am »
Not sure why but the error is gone (I didn't do anything). Since I didn't do anything, I think it might appear again. So any help on how to deal with this would be great.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database Error on the Gallery - No comments visible
« Reply #3 on: November 20, 2012, 12:26:24 pm »
The error would probably be in Sources/Gallery.php around line 2671  or in themes/default/gallery.template.php on the same line.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #4 on: November 20, 2012, 12:29:41 pm »
The error would probably be in Sources/Gallery.php around line 2671  or in themes/default/gallery.template.php on the same line.
Thanks for looking at it. Since I didn't do anything, I'm afraid that it will appear again. I read that usually is on the server side. What's your opinion on what I have to do if it happens again?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database Error on the Gallery - No comments visible
« Reply #5 on: November 20, 2012, 12:56:07 pm »
Attach those two files and can take a look.
Your gallery does not look like it has enough files to run into those limits.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #6 on: November 20, 2012, 05:31:49 pm »
Attach those two files and can take a look.
Your gallery does not look like it has enough files to run into those limits.
Ok, here they are. There are some simple customizations on the files from the "standard" ones that I made.
Thanks.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database Error on the Gallery - No comments visible
« Reply #7 on: November 20, 2012, 06:45:43 pm »
Looks like this query but do not seee how it would excceed max join size.

Code: [Select]
$dbresult = $smcFunc['db_query']('', "
SELECT
c.id_picture, c.id_comment, c.date, c.comment, c.id_member, c.lastmodified,
c.modified_id_member, m.posts, m.real_name, c.approved, r.value
FROM ({db_prefix}gallery_comment as c)
LEFT JOIN {db_prefix}members AS m ON (c.id_member = m.id_member)
LEFT JOIN {db_prefix}gallery_rating AS r ON (r.id_member = c.id_member AND r.id_picture = " . $context['gallery_pic']['id_picture'] . ")
WHERE c.id_picture = " . $context['gallery_pic']['id_picture'] . " AND c.approved = 1 ORDER BY c.id_comment $commentorder");

You could try to run this query before it
Code: [Select]
mysql_query("SET SQL_BIG_SELECTS=1");
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #8 on: November 21, 2012, 05:38:04 am »
Ok, I will try it if the error appears again.

That part of the code is on what file and how should I place the new code on it?

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database Error on the Gallery - No comments visible
« Reply #9 on: November 23, 2012, 11:05:41 am »
Gallery2.template.php Around line 2663
Before
Code: [Select]
// Display all user comments
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Jonas1975

  • Sr. Member
  • ****
  • Posts: 318
    • View Profile
    • The Mobile Photography Blog
Re: Database Error on the Gallery - No comments visible
« Reply #10 on: November 28, 2012, 03:50:59 am »
The error appeared again and that line of code seems to have fixed the issue.

Thanks!

 

Related Topics

  Subject / Started by Replies Last post
10 Replies
10517 Views
Last post February 24, 2009, 08:08:08 pm
by Beltazar
Database Error

Started by pioneer « 1 2 » Support

22 Replies
13079 Views
Last post April 18, 2009, 11:58:55 am
by SMFHacks
3 Replies
2602 Views
Last post December 29, 2010, 01:49:39 pm
by SMFHacks
4 Replies
6343 Views
Last post October 09, 2011, 03:59:37 pm
by SMFHacks
7 Replies
3544 Views
Last post December 10, 2014, 10:26:08 pm
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal