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: 251
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 119
Total: 119

Author Topic: Database error  (Read 3982 times)

0 Members and 1 Guest are viewing this topic.

Offline dan42101

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Database error
« on: November 28, 2013, 07:34:12 pm »
I get this error when trying to delete a comment from pic in user gallery...
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 'LIMIT 1' at line 2
File: /home/content/"My_Forum"/html/forum/Sources/Gallery2.php
Line: 3447


Version Information:
Forum version: SMF 2.0.6 (more detailed)
Current SMF version: SMF 2.0.6
GD version: bundled (2.0.34 compatible)
MySQL version: 5.0.96-log
Alternative PHP Cache: 3.1.13
PHP: 5.3.24
Server version: Apache

Contents of Gallery2.php lines 3423-3485:
function DeleteCommentByID($id)
{
    global $smcFunc, $txt, $modSettings;

    // Get the picture ID for redirect
   $dbresult = $smcFunc['db_query']('', "
   SELECT
      id_picture,id_comment, id_member
   FROM {db_prefix}gallery_comment
   WHERE id_comment = $id LIMIT 1");

   $row = $smcFunc['db_fetch_assoc']($dbresult);
   $picid = $row['id_picture'];
   $memID = $row['id_member'];
   $smcFunc['db_free_result']($dbresult);

   // Delete all the comment reports that comment
   $smcFunc['db_query']('', "DELETE FROM {db_prefix}gallery_creport WHERE id_comment = $id");
   // Now delete the comment.
   $smcFunc['db_query']('', "DELETE FROM {db_prefix}gallery_comment WHERE id_comment = $id LIMIT 1");


   // Update Comment total
    $smcFunc['db_query']('', "UPDATE {db_prefix}gallery_pic
      SET commenttotal = commenttotal - 1 WHERE id_picture = $picid LIMIT 1");

     // Update the SMF Shop Points
         if (isset($modSettings['shopVersion']))
            $smcFunc['db_query']('', "UPDATE {db_prefix}members
               SET money = money - " . $modSettings['gallery_shop_commentadd'] . "
               WHERE id_member = {$memID}
               LIMIT 1");

   return $picid;
}

function DeleteComment()
{
   global $smcFunc, $txt, $modSettings;

   is_not_guest();
   isAllowedTo('smfgallery_manage');

   $id = (int) $_REQUEST['id'];
   if (isset($_REQUEST['ret']))
      $ret = $_REQUEST['ret'];

   if (empty($id))
      fatal_error($txt['gallery_error_no_com_selected']);

   $picid = DeleteCommentByID($id);

   // Redirect to the picture
   if (empty($ret))
   {
      redirectexit('action=gallery;sa=view;id=' . $picid);
   }
   else
   {
      redirectexit('action=admin;area=gallery;sa=commentlist');
   }
}

Thanks in advance...

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database error
« Reply #1 on: November 29, 2013, 09:29:37 am »
Are you using the latest version of the gallery? It does not seem to match up to my line numbers.

If not please attach your Sources/Gallery2.php file.
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 dan42101

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Database error
« Reply #2 on: November 29, 2013, 01:14:55 pm »
I have the one that was at the link at the end of the PayPal process last Sunday...

Will send later tonight when I get home to main box if you like, can't do it from this cell ph.

Thanks.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Database error
« Reply #3 on: December 01, 2013, 05:37:43 pm »
Let me know when you send it over.
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/

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
11607 Views
Last post February 09, 2008, 11:44:03 pm
by ApplianceJunk
10 Replies
10515 Views
Last post February 24, 2009, 08:08:08 pm
by Beltazar
4 Replies
6341 Views
Last post October 09, 2011, 03:59:37 pm
by SMFHacks
3 Replies
2229 Views
Last post September 08, 2014, 11:47:21 pm
by SMFHacks
1 Replies
4719 Views
Last post October 04, 2014, 10:20:35 am
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
Today at 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