Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4212
Latest: bricktop
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 42779
Total Topics: 7453
Most Online Today: 86
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 35
Total: 36

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

+- Recent Topics

Additional Permissions by mickjav
March 18, 2023, 05:21:23 am

[Mod]Discord Web Hooks by SMFHacks
March 17, 2023, 08:48:30 am

Site upgrade to 2.1 by SMFHacks
March 12, 2023, 08:51:19 am

Theme/CSS design wanted by mickjav
March 11, 2023, 12:10:11 pm

Category Images by Anmer
March 10, 2023, 06:20:04 am

DownloadsPro - Topic Link by Anmer
March 08, 2023, 03:18:05 pm

Bulk File Import by SMFHacks
March 08, 2023, 07:56:23 am

Additional Recommendations for SMF Store by SMFHacks
March 07, 2023, 02:41:18 pm

Gallery Selection List Order by mickjav
March 05, 2023, 10:49:10 am

SMF4Mobile 2.0 released for SMF 2.0.x by SMFHacks
February 26, 2023, 01:30:48 pm

Powered by EzPortal