Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4253
Latest: Ineedsmfhelp
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43242
Total Topics: 7516
Most Online Today: 118
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 100
Total: 100

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

+- Recent Topics

is it possible to add support for odysee.com by SMFHacks
March 13, 2024, 10:53:28 pm

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

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

User Gallery Feature: move / bulk move images by SMFHacks
January 30, 2024, 05:48:25 pm

In the future it may be for smf 2.1.x? by smithloo
January 30, 2024, 12:55:34 am

Powered by EzPortal