Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12382
Latest: ImportedPotato
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 40254
Total Topics: 7090
Most Online Today: 85
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 52
Total: 52

Author Topic: Database Error: You have an error in your SQL syntax?  (Read 8237 times)

0 Members and 1 Guest are viewing this topic.

Offline ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Database Error: You have an error in your SQL syntax?
« on: February 09, 2008, 10:26:22 pm »
Not sure what is going on with this error.

Here is what is shows in the error log.

Quote

 Guest                                            Today at 05:59:32 PM 
 99.238.77.127                              b6b3c1ed72d122452b7f9d4425b846d3 

 http://appliancejunk.com/forums/index.php?action=gallery;sa=prev;id=421
 
Database 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 'AND USER_ID_CAT = AND approved = 1 AND ID_PICTURE > 421 LIMIT 1' at line 1
File: /home/content/a/p/p/appliancejunk/html/forums/Sources/Gallery.php
Line: 4763

 

So I go to my forums/Sources/Gallery.php and look at line 4763 and see this.

Code: [Select]
$dbresult = db_query("SELECT ID_PICTURE FROM {$db_prefix}gallery_pic WHERE ID_CAT = $ID_CAT AND USER_ID_CAT =
Here is a little larger section of that code.

Code: [Select]
//Get previous image
$dbresult = db_query("SELECT ID_PICTURE FROM {$db_prefix}gallery_pic WHERE ID_CAT = $ID_CAT AND USER_ID_CAT = $USER_ID_CAT AND approved = 1 AND ID_PICTURE > $id  LIMIT 1", __FILE__, __LINE__);
if(db_affected_rows() != 0)
{
$row = mysql_fetch_assoc($dbresult);
$ID_PICTURE = $row['ID_PICTURE'];
}
else
$ID_PICTURE = $id;

mysql_free_result($dbresult);

redirectexit('action=gallery;sa=view;id=' . $ID_PICTURE);
}
function NextImage()
{
global $db_prefix, $txt, $scripturl;

$id = (int) $_REQUEST['id'];
if(empty($id))
fatal_error($txt['gallery_error_no_pic_selected']);

So it seems to be something that happens when a guest clicks to Get previous image, correct?

Not sure what I need to do or look at to correct this.

Any help would be appreciated.

Thank you,
 AJ



Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15123
    • View Profile
Re: Database Error: You have an error in your SQL syntax?
« Reply #1 on: February 09, 2008, 10:42:04 pm »
Figured it out appears that image was deleted.
http://appliancejunk.com/forums/index.php?action=gallery;sa=view;id=421

And the user/bot was following an old link.
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 ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Database Error: You have an error in your SQL syntax?
« Reply #2 on: February 09, 2008, 11:31:17 pm »
Figured it out appears that image was deleted.
http://appliancejunk.com/forums/index.php?action=gallery;sa=view;id=421

And the user/bot was following an old link.

ok, I was kind of wondering if it was something like that as it started to happen after I removed half a dozen photos from the gallery and a couple of the "guest" were goggle when I checked on there IP's.

So there is nothing I should have to repair or change, correct?


Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15123
    • View Profile
Re: Database Error: You have an error in your SQL syntax?
« Reply #3 on: February 09, 2008, 11:34:26 pm »
Not really. I can add a check to that function just to stay that picture no longer exists if it becomes an issue.
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 ApplianceJunk

  • Sr. Member
  • ****
  • Posts: 432
    • View Profile
    • ApplianceJunk.com
Re: Database Error: You have an error in your SQL syntax?
« Reply #4 on: February 09, 2008, 11:44:03 pm »
Not really. I can add a check to that function just to stay that picture no longer exists if it becomes an issue.

Ok, I don't think it will become a issue for me.

Thanks for your fast replies.


 

Related Topics

  Subject / Started by Replies Last post
4 Replies
5388 Views
Last post September 02, 2008, 08:06:08 pm
by SMFHacks
2 Replies
6182 Views
Last post January 24, 2009, 09:28:41 am
by cepsi
1 Replies
2756 Views
Last post April 02, 2009, 09:06:46 pm
by SMFHacks
4 Replies
3818 Views
Last post October 09, 2011, 03:59:37 pm
by SMFHacks
16 Replies
3673 Views
Last post October 03, 2017, 08:49:37 pm
by drewactual

+- Recent Topics

Moving pictures to another user personal gallery by Hatshepsut
August 10, 2020, 11:07:26 pm

Rebuild related images time too long by SMFHacks
August 09, 2020, 01:52:57 pm

Call to undefined function mysql_num_rows() by SMFHacks
July 30, 2020, 07:45:29 am

Problem with one videosite embedding by Hatshepsut
July 24, 2020, 01:25:08 am

Download System Lite by Rock Lee
June 03, 2020, 07:34:24 pm

Font question by SMFHacks
May 27, 2020, 08:15:26 am

Error message with latest SMF 2.1 Github build by Hatshepsut
May 25, 2020, 01:43:26 am

smfblog not working on 2.0.17 by tech9
May 20, 2020, 01:44:34 pm

Copyright removal by stbc
May 18, 2020, 01:27:57 am

Mod Verified User i can't square the image by Rock Lee
May 07, 2020, 07:56:10 pm

Powered by EzPortal