Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12357
Latest: cyntholsns01
New This Month: 0
New This Week: 1
New Today: 0
Stats
Total Posts: 40081
Total Topics: 7056
Most Online Today: 91
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 38
Total: 38

Author Topic: Database Error: You have an error in your SQL syntax?  (Read 8150 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: 15042
    • 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: 15042
    • 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
5281 Views
Last post September 02, 2008, 08:06:08 pm
by SMFHacks
2 Replies
4006 Views
Last post January 24, 2009, 09:28:41 am
by cepsi
1 Replies
2691 Views
Last post April 02, 2009, 09:06:46 pm
by SMFHacks
4 Replies
3769 Views
Last post October 09, 2011, 03:59:37 pm
by SMFHacks
16 Replies
3197 Views
Last post October 03, 2017, 08:49:37 pm
by drewactual

+- Recent Topics

Only variables should be passed by reference by SMFHacks
Today at 01:42:18 pm

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Cannot import by shawnb
March 02, 2020, 12:17:00 pm

Error message with latest SMF 2.1 Github build by Hatshepsut
March 01, 2020, 10:06:10 am

[Mod]Avatars Display Integration by SMFHacks
February 15, 2020, 07:30:47 pm

[Mod]BBC Message Boxes 1.0 by SMFHacks
February 15, 2020, 07:26:46 pm

Powered by EzPortal