Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 202
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 202
Total: 202

Author Topic: Database error  (Read 3967 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: 16436
    • 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: 16436
    • 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
11569 Views
Last post February 09, 2008, 11:44:03 pm
by ApplianceJunk
10 Replies
10482 Views
Last post February 24, 2009, 08:08:08 pm
by Beltazar
4 Replies
6287 Views
Last post October 09, 2011, 03:59:37 pm
by SMFHacks
3 Replies
2219 Views
Last post September 08, 2014, 11:47:21 pm
by SMFHacks
1 Replies
4684 Views
Last post October 04, 2014, 10:20:35 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

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

Powered by EzPortal